6a8718db by xukangle

fix:数据产品

1 parent a934022e
......@@ -19,6 +19,7 @@ import { getParamsList } from "@/api/modules/dataAsset";
import {
changeNum,
} from "@/utils/common";
import { passFlowData, rejectFlowData, revokeFlowData } from "@/api/modules/workFlowService";
const { proxy } = getCurrentInstance() as any;
const router = useRouter();
......@@ -98,27 +99,64 @@ const tableInfo = ref({
actionInfo: {
label: "操作",
type: "btn",
width: 140,
width: 170,
btns: (scope) => {
let row = scope.row, btnArr: any = [];
if (row.approveState == 'Y') {
if (row.listingStatus == 'Y') {
btnArr.splice(0, 0, { label: "详情", value: "detail" });
} else {
btnArr.splice(0, 0, { label: "编辑", value: "edit" }, { label: "详情", value: "detail" }, { label: "删除", value: "delete" });
const { row } = scope;
const approveVO = row.approveVO || {};
const currentStaffGuid = userData.staffGuid
const bizApproveState = row.bizApproveState;
const approveState = approveVO.approveState || null;
const approveStaffGuids = approveVO.approveStaffGuids || [];
const staffGuid = approveVO.staffGuid || '';
let isShowCancel = false;
let flowState;
let list: any = [];
if (approveState == 'N') {
flowState = 1;
}
if (approveState == 'A' && approveStaffGuids.indexOf(currentStaffGuid) > -1) {
flowState = 2;
}
if ((approveState == 'C' || approveState == 'R') && staffGuid == currentStaffGuid) {
flowState = 3;
}
if (approveVO && approveVO.approveState == 'A' && staffGuid == currentStaffGuid) {
isShowCancel = true;
}
if (flowState === 1) {
list = [{ label: "编辑", value: "edit" }, { label: "删除", value: "del" }]
}
if (flowState === 2) {
list = [{ label: "通过", value: "pass" }, { label: "驳回", value: "reject" }]
}
if (flowState === 3) {
list.push({ label: "删除", value: "del" })
}
if (flowState === 3 && bizApproveState != 'D') {
list.push({ label: "重新提交", value: "redit" }) //已驳回
}
if (isShowCancel) {
list.push({ label: "撤销", value: "revoke" })
}
if (flowState !== 1) {
list.push({ label: "详情", value: "detail" })
}
if (approveState === 'Y') {
if (row.listingStatus === 'Y') {
list.push({ label: "下架", value: "down" });
}
} else {
if (row.approveState == 'A') {
btnArr.splice(0, 0, { label: "详情", value: "detail" });
} else {
btnArr.splice(0, 0, { label: "编辑", value: "edit" }, { label: "详情", value: "detail" }, { label: "删除", value: "delete" });
if (row.listingStatus === 'N') {
list.push({ label: "上架", value: "up" });
}
}
return btnArr;
return list
},
},
}
});
const getTableData = () => {
tableInfo.value.loading = true;
getListingList(
......@@ -210,17 +248,142 @@ const tableSwitchChange = (val, scope, field) => {
})
})
}
const approveSuggest = ref();
const dialogTitle = ref('通过流程');
const dialogVisible = ref(false);
//弹窗类型
const approveType = ref();
const tableBtnClick = (scope, btn) => {
const type = btn.value;
const row = scope.row;
currTableData.value = row;
if (type == "detail" || type === "edit") {
toPatn(type);
} else if (type === "delete") {
open("此操作将永久删除,是否继续?", "warning");
if (type == "detail") {
router.push({
name: 'dataResourceUpDetail',
query: {
guid: row.guid,
}
});
}
};
if (type == "edit" || type == "redit") {
router.push({
name: 'dataResourceUpEdit',
query: {
guid: row.guid,
}
});
}
if (type == 'del') {
ElMessageBox.confirm(`数据删除后不可恢复,确定是否删除?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: 'warning',
}).then(() => {
listingDelete([row.guid]).then((res: any) => {
if (res.code == '00000') {
ElMessage.success('删除成功')
getTableData();
} else {
ElMessage.error(res.msg)
}
})
});
}
//撤销
if (type == 'revoke') {
ElMessageBox.confirm(`撤销后,该流程将不再进行审核,确定这样操作吗?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: 'warning',
}).then(() => {
revokeFlowData({
guid: row.approveVO.approveGuid,
flowType: row.approveVO.flowType,
approveStaffGuid: userData.staffGuid,
}).then((res: any) => {
if (res.code == '00000') {
ElMessage.success('撤销成功!')
getTableData();
} else {
ElMessage.error(res.msg)
}
})
});
}
if (type == 'pass') {
approveSuggest.value = '';
approveType.value = 'pass';
dialogTitle.value = '通过流程'
dialogVisible.value = true;
}
if (type == 'reject') {
approveSuggest.value = '';
approveType.value = 'reject';
dialogTitle.value = '驳回流程'
dialogVisible.value = true;
}
if (type == 'up') {
tableSwitchChange('Y', scope, 'listingStatus')
}
if (type == 'down') {
tableSwitchChange('N', scope, 'listingStatus')
}
}
const fullscreenLoading = ref(false);
const passSubmit = () => {
let row = currTableData.value
console.log(row)
dialogVisible.value = false;
fullscreenLoading.value = true;
passFlowData({
guid: row.approveVO.approveGuid,
flowType: row.approveVO.flowType,
approveSuggest: approveSuggest.value,
approveStaffGuid: userData.staffGuid,
}).then((res: any) => {
fullscreenLoading.value = false;
if (res.code == '00000') {
ElMessage.success('审批通过!')
getTableData();
} else {
ElMessage.error(res.msg)
}
})
}
const rejectSubmit = () => {
if (!approveSuggest.value) return ElMessage.error('请填写驳回理由!')
let row = currTableData.value
dialogVisible.value = false;
fullscreenLoading.value = true;
rejectFlowData({
guid: row.approveVO.approveGuid,
flowType: row.approveVO.flowType,
approveSuggest: approveSuggest.value,
approveStaffGuid: userData.staffGuid,
}).then((res: any) => {
if (res.code == '00000') {
fullscreenLoading.value = false;
ElMessage.success('驳回成功!')
getTableData();
} else {
ElMessage.error(res.msg)
}
})
}
// const tableBtnClick = (scope, btn) => {
// const type = btn.value;
// const row = scope.row;
// currTableData.value = row;
// if (type == "detail" || type === "edit") {
// toPatn(type);
// } else if (type === "delete") {
// open("此操作将永久删除,是否继续?", "warning");
// }
// };
const toPatn = (type) => {
if (type == 'add') {
......@@ -375,6 +538,17 @@ const btnClick = (btn) => {
<Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange"
@tableSwitchBeforeChange="tableSwitchBeforeChange" />
</div>
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="40%">
<el-input type="textarea" :rows="3" maxlength="100" v-model="approveSuggest" resize="none">
</el-input>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button v-if="approveType == 'pass'" type="primary" @click="passSubmit">通过</el-button>
<el-button v-if="approveType == 'reject'" type="primary" @click="rejectSubmit">驳回</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
......
......@@ -804,10 +804,12 @@ const submitForm = (btn, formEl, tosub = false) => {
params.timeAreaStart = params.dateRange ? params.dateRange[0] : '';
params.timeAreaEnd = params.dateRange ? params.dateRange[1] : '';
params.groundingPick = [route.query.groundingPick];
// 删除dateRange字段
delete params.dateRange;
flowDetailLoading.value = true;
if (detailType == 'add') {
params.immediateApprove = btn.value == 'submit' ? true : false;
listingSavePortal(params).then((res: any) => {
if (res.code == proxy.$passCode) {
ElMessage({
......@@ -880,7 +882,7 @@ const submitForm = (btn, formEl, tosub = false) => {
};
const btnClick = (btn) => {
if (btn.value == 'submit') {
if (btn.value == 'submit' || btn.value == 'draft') {
const checkForm = listingFormRef.value;
const formEl = checkForm.ruleFormRef;
const form = checkForm.formInline;
......@@ -1316,18 +1318,35 @@ onBeforeMount(() => {
<span class="item_value">{{ flowDetail.damName || '--' }}</span>
</div>
<div class="list_item">
<span class="item_label">产品类型:</span>
<span class="item_label">资产类型:</span>
<span class="item_value">{{ flowDetail.damTypeName || '--' }}</span>
</div>
<div class="list_item">
<span class="item_label">所属主题:</span>
<span class="item_label">证书编号:</span>
<span class="item_value">{{ flowDetail.damCode || '--' }}</span>
</div>
<div class="list_item">
<span class="item_label">数据时间范围:</span>
<span class="item_value">{{ flowDetail.subjectDomainName || '--' }}</span>
</div>
<div class="list_item">
<span class="item_label">证书编号:</span>
<span class="item_value">{{ flowDetail.damCode || '--' }}</span>
<span class="item_label">交付方式:</span>
<span class="item_value">{{ flowDetail.subjectDomainName || '--' }}</span>
</div>
<div class="list_item">
<span class="item_label">定价方式:</span>
<span class="item_value">{{ flowDetail.subjectDomainName || '--' }}</span>
</div>
<div class="list_item">
<span class="item_label">定价金额:</span>
<span class="item_value">{{ flowDetail.subjectDomainName || '--' }}</span>
</div>
<div class="list_item">
<span class="item_label">所属主题:</span>
<span class="item_value">{{ flowDetail.subjectDomainName || '--' }}</span>
</div>
<div class="list_item">
<span class="item_label">数据规模(条):</span>
<span class="item_value">{{ flowDetail.dataScale != null ? changeNum(flowDetail.dataScale, 0) : '--'
}}</span>
......@@ -1348,7 +1367,7 @@ onBeforeMount(() => {
}}</span>
</div>
<div class="list_item">
<span class="item_label">审核后上架:</span>
<span class="item_label">登记数交所:</span>
<span class="item_value">{{ flowDetail.isApproveGrounding == 'Y' ? `自动上架` : '手动上架' }}</span>
</div>
<div class="list_item is_block">
......@@ -1489,8 +1508,9 @@ onBeforeMount(() => {
</div>
<div class="tool_btns" v-if="detailType == 'add' || detailType == 'edit'">
<div class="btns">
<el-button @click="btnClick({ value: 'cancel' })">取消</el-button>
<el-button type="primary" @click="btnClick({ value: 'submit' })">提交</el-button>
<el-button @click="btnClick({ value: 'cancel' })">返回</el-button>
<el-button @click="btnClick({ value: 'draft' })">保存草稿</el-button>
<el-button type="primary" @click="btnClick({ value: 'submit' })">提交流程</el-button>
</div>
</div>
<div class="tool_btns" v-else-if="detailType == 'check'">
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!