|
@@ -19,8 +19,11 @@
|
|
|
<el-input type="textarea" placeholder="请输入" v-model="flowForm.remark"> </el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" v-if="approvalRecordData.buttonInfoList.length == 0" @click="handleSubmit" :loading="btnLoading">提交</el-button>
|
|
|
- <el-button type="primary" v-else v-for="i in approvalRecordData.buttonInfoList" :key="i.type" :loading="btnLoading" @click="handleSubmit(i.type)">
|
|
|
+ <el-button type="primary" v-if="!route.query.processType || ['30', '40'].includes(route.query.processType)" @click="handleSaveDraft" v-preReClick>
|
|
|
+ 保存草稿
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" v-if="approvalRecordData.buttonInfoList.length == 0" @click="handleSubmit" v-preReClick>提交</el-button>
|
|
|
+ <el-button type="primary" v-else v-for="i in approvalRecordData.buttonInfoList" :key="i.type" @click="handleSubmit(i.type)" v-preReClick>
|
|
|
{{ i.name }}
|
|
|
</el-button>
|
|
|
</el-form-item>
|
|
@@ -35,13 +38,13 @@
|
|
|
v-for="item in recordList"
|
|
|
:key="item.id"
|
|
|
:class="
|
|
|
- !route.query.id
|
|
|
+ !route.query.flowId
|
|
|
? ''
|
|
|
: item.status == 2
|
|
|
? 'flow-orange'
|
|
|
- : item.status == 3 && !route.query.id
|
|
|
+ : item.status == 3 && !route.query.flowId
|
|
|
? 'flow-orange'
|
|
|
- : item.status == 3 && route.query.id
|
|
|
+ : item.status == 3 && route.query.flowId
|
|
|
? 'flow-grey'
|
|
|
: ''
|
|
|
">
|
|
@@ -104,7 +107,6 @@ const router = useRouter();
|
|
|
const route = useRoute();
|
|
|
// tab切换逻辑
|
|
|
const activeName = ref("first");
|
|
|
-const btnLoading = ref(false);
|
|
|
// 意见表单
|
|
|
const flowForm = reactive({
|
|
|
flowKey: "",
|
|
@@ -146,14 +148,13 @@ const handleSubmit = async (_type) => {
|
|
|
const flag = await proxy.$refs.makeDom.handleSubmit();
|
|
|
if (flag) {
|
|
|
flowFormDom.value.validate((valid) => {
|
|
|
- btnLoading.value = true;
|
|
|
if (valid) {
|
|
|
const data = { ...proxy.$refs.makeDom.getFormData() };
|
|
|
- if (route.query.processType == 10 || route.query.processType == 30) {
|
|
|
+ if (route.query.processType == '10' || route.query.processType == '30') {
|
|
|
if (_type && _type == 1) {
|
|
|
proxy
|
|
|
.post("/flowExample/setStartData", {
|
|
|
- exampleId: route.query.id,
|
|
|
+ exampleId: route.query.flowId,
|
|
|
startData: data,
|
|
|
})
|
|
|
.then();
|
|
@@ -164,16 +165,11 @@ const handleSubmit = async (_type) => {
|
|
|
data,
|
|
|
handleType: _type,
|
|
|
version: route.query.version,
|
|
|
- flowId: route.query.id,
|
|
|
+ flowId: route.query.flowId,
|
|
|
})
|
|
|
- .then(
|
|
|
- (res) => {
|
|
|
- handleResult(res);
|
|
|
- },
|
|
|
- () => {
|
|
|
- btnLoading.value = false;
|
|
|
- }
|
|
|
- );
|
|
|
+ .then((res) => {
|
|
|
+ handleResult(res);
|
|
|
+ });
|
|
|
return;
|
|
|
} else {
|
|
|
proxy
|
|
@@ -181,14 +177,9 @@ const handleSubmit = async (_type) => {
|
|
|
...flowForm,
|
|
|
data,
|
|
|
})
|
|
|
- .then(
|
|
|
- (res) => {
|
|
|
- handleResult(res);
|
|
|
- },
|
|
|
- () => {
|
|
|
- btnLoading.value = false;
|
|
|
- }
|
|
|
- );
|
|
|
+ .then((res) => {
|
|
|
+ handleResult(res);
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -201,7 +192,7 @@ const handleSubmit = async (_type) => {
|
|
|
const skipPage = () => {
|
|
|
const useTagsStore = useTagsViewStore();
|
|
|
useTagsStore.delVisitedView(router.currentRoute.value);
|
|
|
- if (route.query.processType) {
|
|
|
+ if (route.query.processType && route.query.processType != '40') {
|
|
|
router.replace({
|
|
|
path: "/oa/1/dealWith",
|
|
|
});
|
|
@@ -251,7 +242,27 @@ const getRecords = (_id) => {
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
-onMounted(async () => {
|
|
|
+const handleSaveDraft = async () => {
|
|
|
+ const flag = await proxy.$refs.makeDom.handleSubmit();
|
|
|
+ if (flag) {
|
|
|
+ if (flowForm.flowKey == "apply_buy") {
|
|
|
+ let data = proxy.$refs.makeDom.getFormData();
|
|
|
+ if (data.id) {
|
|
|
+ proxy.post("/applyBuy/edit", data).then(() => {
|
|
|
+ skipPage();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ proxy.post("/applyBuy/add", data).then(() => {
|
|
|
+ skipPage();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+onMounted(() => {
|
|
|
+ //processType 10 为修改 20为查看 30回退发起
|
|
|
+ flowForm.flowKey = route.query.flowKey;
|
|
|
+ flowForm.tenantType = route.query.tenantType;
|
|
|
if (route.query.random) {
|
|
|
useTagsViewStore().visitedViews = useTagsViewStore().visitedViews.map((item) => {
|
|
|
if (item.query && item.query.random === route.query.random) {
|
|
@@ -267,17 +278,12 @@ onMounted(async () => {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- //processType 10 为修改 20为查看 30回退发起
|
|
|
- if (route.query.processType == 10 || route.query.processType == 20 || route.query.processType == 30) {
|
|
|
- await proxy.post("/flowProcess/getStartData", { flowId: route.query.id }).then((res) => {
|
|
|
+ if (route.query.flowKey == "apply_buy") {
|
|
|
+ proxy.post("/applyBuy/detail", { id: route.query.id }).then((res) => {
|
|
|
queryData.data = { ...res };
|
|
|
});
|
|
|
- } else {
|
|
|
- queryData.data = { ...route.query };
|
|
|
}
|
|
|
- flowForm.flowKey = route.query.flowKey;
|
|
|
- flowForm.tenantType = route.query.tenantType;
|
|
|
- getRecords(route.query.id);
|
|
|
+ getRecords(route.query.flowId);
|
|
|
});
|
|
|
</script>
|
|
|
<style>
|