设计变更审批
This commit is contained in:
@ -88,12 +88,16 @@ const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
//路由参数
|
||||
const routeParams = ref<Record<string, any>>({});
|
||||
const flowCodeOptions = [
|
||||
const flowCodeOptions = ref([
|
||||
{
|
||||
value: currentProject.value?.id + '_designchanged',
|
||||
label: '变更图纸审批'
|
||||
},
|
||||
{
|
||||
value: currentProject.value?.id + '_moneydesignchanged',
|
||||
label: '资金设计变更审批'
|
||||
}
|
||||
];
|
||||
]);
|
||||
|
||||
const flowCode = ref<string>('');
|
||||
const status = ref<string>('');
|
||||
@ -129,6 +133,7 @@ const initFormData = {
|
||||
fileUrl: undefined,
|
||||
fileType: undefined,
|
||||
fileSuffix: undefined,
|
||||
costEstimation: undefined,
|
||||
originalName: undefined,
|
||||
remark: undefined,
|
||||
fileId: undefined
|
||||
@ -144,6 +149,7 @@ const data = reactive({
|
||||
fileSuffix: undefined,
|
||||
fileStatus: undefined,
|
||||
originalName: undefined,
|
||||
costEstimation: undefined,
|
||||
newest: undefined,
|
||||
params: {}
|
||||
},
|
||||
@ -182,8 +188,13 @@ const getInfo = () => {
|
||||
loading.value = true;
|
||||
buttonLoading.value = false;
|
||||
nextTick(async () => {
|
||||
const res = await getDesignChange(routeParams.value.id);
|
||||
var id = routeParams.value.id;
|
||||
if (routeParams.value.type === 'approval') {
|
||||
id = routeParams.value.id.split('_')[0];
|
||||
}
|
||||
const res = await getDesignChange(id);
|
||||
Object.assign(form.value, res.data);
|
||||
if (res.data.costEstimation) form.value.status = res.data.auditStatus;
|
||||
loading.value = false;
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
@ -248,6 +259,8 @@ const approvalVerifyOpen = async () => {
|
||||
// 图纸上传成功之后 开始提交
|
||||
const submit = async (status, data) => {
|
||||
form.value = data;
|
||||
form.value.id = routeParams.value.type == 'add' ? form.value.id + '_' : form.value.id.split('_')[0];
|
||||
form.value.status = data.auditStatus ? data.auditStatus : data.status;
|
||||
if (status === 'draft') {
|
||||
buttonLoading.value = false;
|
||||
proxy?.$modal.msgSuccess('暂存成功');
|
||||
@ -255,7 +268,13 @@ const submit = async (status, data) => {
|
||||
proxy.$router.go(-1);
|
||||
} else {
|
||||
if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||
flowCode.value = flowCodeOptions[0].value;
|
||||
if (form.value.costEstimation == '0') {
|
||||
flowCodeOptions.value = [flowCodeOptions.value[0]];
|
||||
} else {
|
||||
console.log('🚀 ~ submit ~ flowCodeOptions.value:', flowCodeOptions.value[1]);
|
||||
flowCodeOptions.value = [flowCodeOptions.value[1]];
|
||||
}
|
||||
flowCode.value = flowCodeOptions.value[0].value;
|
||||
dialogVisible.visible = true;
|
||||
return;
|
||||
}
|
||||
@ -275,6 +294,8 @@ onMounted(() => {
|
||||
loading.value = false;
|
||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||
getInfo();
|
||||
} else {
|
||||
form.value.costEstimation = routeParams.value.costEstimation;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user