|
@@ -116,7 +116,7 @@
|
|
|
</div>
|
|
|
<div v-else-if="type === '2'">
|
|
|
<el-button @click="handleTurn('finish')">结束</el-button>
|
|
|
- <el-button @click="handleTurn('back')">退回</el-button>
|
|
|
+ <el-button @click="handleTurn('return')">退回</el-button>
|
|
|
<el-button @click="handleTurn('back')">打回</el-button>
|
|
|
<el-button @click="handleTurn('transfer')" type="primary"
|
|
|
>转总经理审批</el-button
|
|
@@ -124,6 +124,7 @@
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
<el-button @click="handleTurn('back')">打回</el-button>
|
|
|
+ <el-button @click="handleTurn('return')">退回</el-button>
|
|
|
<el-button @click="handleTurn('agree')" type="primary"
|
|
|
>同意</el-button
|
|
|
>
|
|
@@ -135,7 +136,7 @@
|
|
|
title="转派"
|
|
|
:visible="transfer_visible"
|
|
|
:reload="reload"
|
|
|
- width="500px"
|
|
|
+ width="1000px"
|
|
|
@confirm="transferConfirm"
|
|
|
@cancel="handleCancel('transfer_visible')"
|
|
|
>
|
|
@@ -145,68 +146,85 @@
|
|
|
ref="transfer_form"
|
|
|
label-width="80px"
|
|
|
>
|
|
|
- <el-form-item label="转派人员" prop="personnel">
|
|
|
- <el-select
|
|
|
- filterable
|
|
|
- v-model="transfer_form.personnel"
|
|
|
- placeholder="请选择转派人员"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in transfer_list"
|
|
|
- :key="index"
|
|
|
- :label="item.label"
|
|
|
- :value="item.loginNoStr"
|
|
|
+ <el-form-item
|
|
|
+ label="转派人员"
|
|
|
+ v-for="(item, index) in transfer_form.charge"
|
|
|
+ :key="index"
|
|
|
+ :rules="{
|
|
|
+ required: true,
|
|
|
+ message: '负责人不能为空',
|
|
|
+ trigger: 'blur',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <div class="flex">
|
|
|
+ <el-select
|
|
|
+ class="margin-bottom-20 margin-right-10"
|
|
|
+ placeholder="请选择负责人"
|
|
|
+ v-model="item.person"
|
|
|
+ @change="personChange"
|
|
|
+ filterable
|
|
|
>
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="可编辑行" prop="col_start">
|
|
|
- <div class="form-select">
|
|
|
- <span class="form-content">从</span>
|
|
|
- <el-input v-model="transfer_form.col_start" />
|
|
|
- <span class="form-content">到</span
|
|
|
- ><el-input v-model="transfer_form.col_end" />
|
|
|
+ <el-option
|
|
|
+ v-for="({ label, value }, index) in transfer_list_orgin"
|
|
|
+ :key="index"
|
|
|
+ :label="label"
|
|
|
+ :value="value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ <div v-if="permission_type === 2">
|
|
|
+ <span class="form-content">可编辑行:</span>
|
|
|
+ <el-select
|
|
|
+ class="margin-bottom-20 margin-right-10"
|
|
|
+ placeholder="请选择可编辑行"
|
|
|
+ multiple
|
|
|
+ v-model="item.allowEditingColumns"
|
|
|
+ @change="colsChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in transfer_cols_orgin"
|
|
|
+ :key="index"
|
|
|
+ :label="item"
|
|
|
+ :value="item"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div v-if="permission_type === 2">
|
|
|
+ <span class="form-content">可编辑列:</span>
|
|
|
+ <el-select
|
|
|
+ class="margin-bottom-20 margin-right-10"
|
|
|
+ placeholder="请选择可编辑列"
|
|
|
+ multiple
|
|
|
+ v-model="item.rowNum"
|
|
|
+ @change="rowsChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in transfer_rows_orgin"
|
|
|
+ :key="index"
|
|
|
+ :label="item"
|
|
|
+ :value="item"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <!-- <el-select
|
|
|
- v-model="transfer_form.rows"
|
|
|
- placeholder="可编辑行"
|
|
|
- multiple
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in transfer_rows"
|
|
|
- :key="index"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select> -->
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="可编辑列" prop="row_start">
|
|
|
- <div class="form-select">
|
|
|
- <span class="form-content">从</span>
|
|
|
- <el-input v-model="transfer_form.row_start" />
|
|
|
- <span class="form-content">到</span>
|
|
|
- <el-input v-model="transfer_form.row_end" />
|
|
|
- </div>
|
|
|
- <!-- <el-select
|
|
|
- v-model="transfer_form.rows"
|
|
|
- placeholder="可编辑行"
|
|
|
- multiple
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ class="margin-right-10"
|
|
|
+ @click.prevent="handleCharge('add')"
|
|
|
+ type="primary"
|
|
|
+ >添加</el-button
|
|
|
>
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in transfer_rows"
|
|
|
- :key="index"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select> -->
|
|
|
- </el-form-item>
|
|
|
+ <el-button
|
|
|
+ v-if="transfer_form.charge.length - 1"
|
|
|
+ @click.prevent="handleCharge('delete')"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
</el-form>
|
|
|
</simple-dialog>
|
|
|
<simple-dialog
|
|
|
title="回复详情"
|
|
|
- width="700px"
|
|
|
+ width="1000px"
|
|
|
@cancel="handleCancel('principal_visible')"
|
|
|
@confirm="handleCancel('principal_visible')"
|
|
|
:visible="principal_visible"
|
|
@@ -269,6 +287,8 @@ export default {
|
|
|
total: 0,
|
|
|
reviewType: "",
|
|
|
isCheck: false,
|
|
|
+ // 判断是否为2---特殊权限或者为1---公共权限
|
|
|
+ permission_type: 2,
|
|
|
// 职位判断转派用
|
|
|
duty: "",
|
|
|
// 搜索参数
|
|
@@ -285,38 +305,38 @@ export default {
|
|
|
principal_visible: false,
|
|
|
edit_form: {},
|
|
|
// 回复详情
|
|
|
- receiver_table_list: [
|
|
|
- {
|
|
|
- receiver: "接收人",
|
|
|
- department: "科室",
|
|
|
- date: "回复时间",
|
|
|
- value: "2021.11.4 XXX 同意\n2021.11.4 XXX 同意",
|
|
|
- },
|
|
|
- ],
|
|
|
+ receiver_table_list: [],
|
|
|
receiver_table_config: [
|
|
|
{
|
|
|
label: "接收人",
|
|
|
- props: "receiver",
|
|
|
+ props: "receiveName",
|
|
|
},
|
|
|
{
|
|
|
label: "科室",
|
|
|
- props: "department",
|
|
|
+ props: "dept",
|
|
|
},
|
|
|
{
|
|
|
label: "回复时间",
|
|
|
- props: "date",
|
|
|
+ props: "createTime",
|
|
|
},
|
|
|
{
|
|
|
label: "审批记录",
|
|
|
- props: "value",
|
|
|
+ props: "result",
|
|
|
+ type: "textarea",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "审批意见",
|
|
|
+ props: "opinion",
|
|
|
type: "textarea",
|
|
|
},
|
|
|
],
|
|
|
+ transfer_list_orgin: [],
|
|
|
+ transfer_cols_orgin: [],
|
|
|
+ transfer_rows_orgin: [],
|
|
|
transfer_list: [],
|
|
|
- transfer_rows: [],
|
|
|
transfer_form: {
|
|
|
- personnel: "", // 转派人员
|
|
|
- rows: [],
|
|
|
+ // personnel: "", // 转派人员
|
|
|
+ charge: [{ person: "", allowEditingColumns: [], rowNum: [] }],
|
|
|
},
|
|
|
reload: 0,
|
|
|
// 判断类型
|
|
@@ -539,8 +559,9 @@ export default {
|
|
|
"Content-Type": "application/json",
|
|
|
},
|
|
|
data: { id: this.edit_form.id },
|
|
|
- }).then(({ data: { reviewType } }) => {
|
|
|
+ }).then(({ data: { reviewType, list } }) => {
|
|
|
// 判断审批按钮是否还存在
|
|
|
+ this.permission_type = Number(list[0].type);
|
|
|
console.log(reviewType, "res");
|
|
|
this.reviewType = reviewType;
|
|
|
switch (reviewType) {
|
|
@@ -598,48 +619,116 @@ export default {
|
|
|
handleTrack() {
|
|
|
this.track_visible = true;
|
|
|
},
|
|
|
+ // 转派的增加或删除
|
|
|
+ handleCharge(type) {
|
|
|
+ switch (type) {
|
|
|
+ case "add":
|
|
|
+ this.transfer_form.charge.push({
|
|
|
+ person: "",
|
|
|
+ allowEditingColumns: [],
|
|
|
+ rowNum: [],
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case "delete":
|
|
|
+ this.transfer_form.charge.pop();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 三个change事件控制行列人员变动
|
|
|
+ personChange(val) {
|
|
|
+ console.log(val, this.transfer_list);
|
|
|
+ this.transfer_list = this.transfer_list.filter((el) => el.value !== val);
|
|
|
+ console.log(this.transfer_list, "this.transfer_list");
|
|
|
+ },
|
|
|
+ rowsChange(val) {
|
|
|
+ console.log(val, "rowsChange");
|
|
|
+ },
|
|
|
+ colsChange(val) {
|
|
|
+ console.log(val, "colsChange");
|
|
|
+ },
|
|
|
+ handleForbid() {
|
|
|
+ const permission_type = this.permission_type;
|
|
|
+ const { charge } = this.transfer_form;
|
|
|
+ let flag = 1;
|
|
|
+ console.log(permission_type, "permission_type");
|
|
|
+ if (permission_type === 1) {
|
|
|
+ // 公共权限 暂时不用可编辑行和列
|
|
|
+ charge.forEach((el) => {
|
|
|
+ if (el.person) {
|
|
|
+ flag = flag * 1;
|
|
|
+ } else {
|
|
|
+ flag = flag * 0;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else if (permission_type === 2) {
|
|
|
+ // 特殊权限
|
|
|
+ console.log(permission_type, "permission_type");
|
|
|
+ charge.forEach((el) => {
|
|
|
+ if (el.person && el.allowEditingColumns.length && el.rowNum.length) {
|
|
|
+ flag = flag * 1;
|
|
|
+ } else {
|
|
|
+ flag = flag * 0;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return flag;
|
|
|
+ },
|
|
|
// 转派的同意事件
|
|
|
- transferConfirm() {
|
|
|
+ async transferConfirm() {
|
|
|
this.$refs["transfer_form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- let obj = {};
|
|
|
- this.transfer_form.rows.forEach((el) => {
|
|
|
- obj = {
|
|
|
- ...obj,
|
|
|
- [el]: this.transfer_form.personnel,
|
|
|
+ if (this.handleForbid()) {
|
|
|
+ const { charge } = this.transfer_form;
|
|
|
+ let params = {
|
|
|
+ issuedId: this.edit_form.id,
|
|
|
};
|
|
|
- });
|
|
|
- let reqdata = {
|
|
|
- forward: JSON.stringify(obj),
|
|
|
- issuedId: this.edit_form.id,
|
|
|
- };
|
|
|
- this.$http({
|
|
|
- url: "/market/CMKIssued/CMKIssuedTransfer",
|
|
|
- method: "post",
|
|
|
- headers: {
|
|
|
- "Content-Type": "application/json",
|
|
|
- },
|
|
|
- data: reqdata,
|
|
|
- }).then(({ data: { desc } }) => {
|
|
|
- if (desc === "转派成功") {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: desc,
|
|
|
- });
|
|
|
- this.transfer_visible = false;
|
|
|
- this.handleInit({
|
|
|
- ...this.table_search,
|
|
|
- page: this.page,
|
|
|
- pageSize: this.rows,
|
|
|
- });
|
|
|
- this.handleCancel("visible");
|
|
|
+ if (this.permission_type === 1) {
|
|
|
+ params.transferCommonAuthority = charge
|
|
|
+ .map((el) => {
|
|
|
+ el = el.person.split(",")[0];
|
|
|
+ return el;
|
|
|
+ })
|
|
|
+ .join(",");
|
|
|
+ } else if (this.permission_type === 2) {
|
|
|
+ params.transferAuthority = charge.map((el) =>
|
|
|
+ JSON.stringify({
|
|
|
+ allowEditingColumns: el.allowEditingColumns.join(","),
|
|
|
+ rowNum: el.rowNum.join(","),
|
|
|
+ principalId: el.person.split(",")[0],
|
|
|
+ principalName: el.person.split(",")[1],
|
|
|
+ })
|
|
|
+ );
|
|
|
}
|
|
|
- });
|
|
|
+ this.$http({
|
|
|
+ url: "/market/CMKIssued/CMKIssuedTransfer",
|
|
|
+ method: "post",
|
|
|
+ headers: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ data: params,
|
|
|
+ }).then(({ data: { desc } }) => {
|
|
|
+ if (desc === "转派成功") {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: desc,
|
|
|
+ });
|
|
|
+ this.transfer_visible = false;
|
|
|
+ this.handleInit({
|
|
|
+ ...this.table_search,
|
|
|
+ page: this.page,
|
|
|
+ pageSize: this.rows,
|
|
|
+ });
|
|
|
+ this.handleCancel("visible");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log(params, "this.transfer_form");
|
|
|
+ } else {
|
|
|
+ this.$message.error("请填写必要的信息");
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
async handleTransfer() {
|
|
|
- console.log(this.edit_form, "prams");
|
|
|
let loginNoStr = JSON.parse(sessionStorage.userInfo).loginNoStr;
|
|
|
let groupId = JSON.parse(sessionStorage.userInfo).groupId;
|
|
|
await this.$http({
|
|
@@ -652,32 +741,31 @@ export default {
|
|
|
groupId,
|
|
|
},
|
|
|
}).then(({ data }) => {
|
|
|
- this.transfer_list = data
|
|
|
+ this.transfer_list_orgin = data
|
|
|
.filter((el) => {
|
|
|
return el.loginNoStr !== loginNoStr;
|
|
|
})
|
|
|
.map((el) => ({
|
|
|
...el,
|
|
|
- label: el.loginNameStr,
|
|
|
+ label: `${el.loginNameStr}`,
|
|
|
+ value: `${el.loginNoStr},${el.loginNameStr}`,
|
|
|
}));
|
|
|
+ this.transfer_list = this.transfer_list_orgin;
|
|
|
// 可编辑行
|
|
|
});
|
|
|
- // await this.$http({
|
|
|
- // url: "/market/CMKIssued/CMKIssuedRow",
|
|
|
- // method: "post",
|
|
|
- // headers: {
|
|
|
- // "Content-Type": "application/json",
|
|
|
- // },
|
|
|
- // data: {
|
|
|
- // id: this.edit_form.id,
|
|
|
- // },
|
|
|
- // }).then(({ data }) => {
|
|
|
- // console.log(data);
|
|
|
- // // this.transfer_rows = data.map((el) => ({
|
|
|
- // // label: el,
|
|
|
- // // value: el,
|
|
|
- // // }));
|
|
|
- // });
|
|
|
+ await this.$http({
|
|
|
+ url: "/market/CMKIssued/CMKIssuedRow",
|
|
|
+ method: "post",
|
|
|
+ headers: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ id: this.edit_form.id,
|
|
|
+ },
|
|
|
+ }).then(({ data: { column, row } }) => {
|
|
|
+ this.transfer_cols_orgin = column.split(",");
|
|
|
+ this.transfer_rows_orgin = row.split(",");
|
|
|
+ });
|
|
|
this.transfer_visible = true;
|
|
|
},
|
|
|
handleTurn(type) {
|
|
@@ -691,36 +779,43 @@ export default {
|
|
|
case "finish":
|
|
|
// status 0.打回 3.结束
|
|
|
reqdata.status = "3";
|
|
|
+ reqdata.operateName = "结束";
|
|
|
request = 1;
|
|
|
break;
|
|
|
case "transfer":
|
|
|
// reviewType 2.副总经理 3总经理
|
|
|
if (this.duty === "7") {
|
|
|
reqdata.reviewType = 2;
|
|
|
+ reqdata.operateName = "转副总审批";
|
|
|
request = 1;
|
|
|
} else if (this.duty === "2") {
|
|
|
reqdata.reviewType = 3;
|
|
|
request = 1;
|
|
|
+ reqdata.operateName = "转总经理审批";
|
|
|
}
|
|
|
break;
|
|
|
case "back":
|
|
|
reqdata.status = "0";
|
|
|
reqdata.reviewType = 1;
|
|
|
request = 1;
|
|
|
+ reqdata.operateName = "打回";
|
|
|
+ break;
|
|
|
+ case "return":
|
|
|
+ reqdata.status = "0";
|
|
|
+ reqdata.operateName = "退回";
|
|
|
+ if (this.duty === "2") {
|
|
|
+ reqdata.reviewType = 1;
|
|
|
+ } else if (this.duty === "3") {
|
|
|
+ reqdata.reviewType = 2;
|
|
|
+ }
|
|
|
+ request = 1;
|
|
|
break;
|
|
|
case "agree":
|
|
|
+ reqdata.operateName = "同意";
|
|
|
reqdata.status = "3";
|
|
|
request = 1;
|
|
|
break;
|
|
|
}
|
|
|
- console.log(reqdata, "reqdata");
|
|
|
- this.handleInit({
|
|
|
- ...this.table_search,
|
|
|
- page: this.page,
|
|
|
- pageSize: this.rows,
|
|
|
- });
|
|
|
- // this.handleCancel("visible");
|
|
|
- // this.handleCancel("approve_visible");
|
|
|
if (request) {
|
|
|
// 这里调接口
|
|
|
this.$http({
|
|
@@ -744,6 +839,39 @@ export default {
|
|
|
page: this.page,
|
|
|
pageSize: this.rows,
|
|
|
});
|
|
|
+ } else if (desc === "存在未提交,是否还要审核") {
|
|
|
+ this.$confirm(desc, {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ this.$http({
|
|
|
+ url: "/market/CMKIssued/CMKIssuedCheck",
|
|
|
+ method: "post",
|
|
|
+ headers: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ data: { ...reqdata, submitFlag: 1 },
|
|
|
+ }).then(({ data: { desc } }) => {
|
|
|
+ if (desc === "审批成功") {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: desc,
|
|
|
+ });
|
|
|
+ this.handleCancel("visible");
|
|
|
+ this.handleCancel("approve_visible");
|
|
|
+ this.handleInit({
|
|
|
+ ...this.table_search,
|
|
|
+ page: this.page,
|
|
|
+ pageSize: this.rows,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -763,7 +891,15 @@ export default {
|
|
|
// this.handleCancel("approve_visible");
|
|
|
// });
|
|
|
},
|
|
|
-
|
|
|
+ // 通用方法用于转化全局
|
|
|
+ paramsArr(start, end) {
|
|
|
+ const arr = [];
|
|
|
+ console.log(start, end);
|
|
|
+ for (let i = Number(start); i <= Number(end); i++) {
|
|
|
+ arr.push(i);
|
|
|
+ }
|
|
|
+ return arr.join(",");
|
|
|
+ },
|
|
|
handleConfirm(visible) {
|
|
|
console.log(visible);
|
|
|
this.track_visible = visible;
|
|
@@ -780,6 +916,16 @@ export default {
|
|
|
// 回复详情
|
|
|
console.log(id);
|
|
|
this.principal_visible = true;
|
|
|
+ this.$http({
|
|
|
+ url: "/market/CMKIssued/replyDetails",
|
|
|
+ method: "post",
|
|
|
+ headers: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ data: { issuedId: id },
|
|
|
+ }).then(({data}) => {
|
|
|
+ this.receiver_table_list = data
|
|
|
+ });
|
|
|
},
|
|
|
// 关闭方法
|
|
|
handleCancel(data) {
|