Commit 90046ad6 authored by zhengyi's avatar zhengyi

当费用申请记录的费用金额为0时,允许直接删除该条记录

parent a5b25c53
......@@ -108,6 +108,13 @@ export function feeApplicationCreateBatch(data){
data:data,
})
}
// 删除申请费用
export function feeApplicationDelete(id){
return request({
url:'order/fee-application/delete?id=' + id,
method:'delete',
})
}
// 根据订单ID获取是否有正在申请的费用申请
export function getFeeApplicationApproveByOrderId(orderId){
......
......@@ -13,24 +13,32 @@
<el-divider></el-divider>
<el-form label-width="100px" inline>
<el-form-item :label="$t('订单号') + ':'"
><div class="content">
>
<div class="content">
{{ orderDetails.orderNo }}
</div></el-form-item
</div>
</el-form-item
>
<el-form-item :label="$t('发货人') + ':'"
><div class="content">
>
<div class="content">
{{ orderDetails.consignorVO ? orderDetails.consignorVO.name : "" }}
</div></el-form-item
</div>
</el-form-item
>
<el-form-item :label="$t('唛头')"
><div class="content">{{ orderDetails.marks }}</div></el-form-item
>
<div class="content">{{ orderDetails.marks }}</div>
</el-form-item
>
<el-form-item>
<el-button
:disabled="!!processInstanceId || editMode"
@click="addCost"
>{{ $t("添加申请") }}</el-button
></el-form-item
>{{ $t("添加申请") }}
</el-button
>
</el-form-item
>
</el-form>
<el-table :data="list">
......@@ -106,25 +114,35 @@
<template v-slot:default="scope">
<el-tag v-if="scope.row.status !== 0 && !scope.row.editMode">{{
STATUS[scope.row.status]
}}</el-tag>
}}
</el-tag>
<!--el-button type="text" v-if="scope.row.status == 1" @click="examineFn">{{$t('审核中')}}</el-button-->
<el-button
type="text"
v-if="modifable(scope.$index)"
@click="modify(scope.row)"
>{{ $t("修改") }}</el-button
>{{ $t("修改") }}
</el-button
>
<el-button
type="text"
v-if="scope.row.status === 0"
@click="del(scope.$index)"
>删除</el-button
>删除
</el-button
>
<el-button
type="text"
v-if="scope.row.id && scope.row.applicationFee === 0"
@click="deleteByFeeIsZero(scope.row.id)"
>删除
</el-button
>
</template>
</el-table-column>
</el-table>
<div style="padding: 20px">
<work-flow xmlkey="free_apply" v-model="selectedUsers" />
<work-flow xmlkey="free_apply" v-model="selectedUsers"/>
</div>
<div style="text-align: center; margin-top: 20px">
<el-button
......@@ -133,25 +151,29 @@
style="margin-right: 30px"
:disabled="!feeList.length && !editMode"
@click="submit"
>{{ $t("提交") }}</el-button
>{{ $t("提交") }}
</el-button
>
<el-button
type="primary"
v-if="processInstanceId"
style="margin-right: 30px"
@click="goProcessDetail"
>{{ $t("审核中") }}</el-button
>{{ $t("审核中") }}
</el-button
>
<el-button
type="primary"
v-if="processInstanceId"
style="margin-right: 30px"
@click="cancel"
>{{ $t("取消审核") }}</el-button
>{{ $t("取消审核") }}
</el-button
>
<el-button @click="$emit('update:dialogVisible', false)">{{
$t("返回")
}}</el-button>
}}
</el-button>
</div>
</div>
</el-dialog>
......@@ -168,13 +190,14 @@ import {
getFeeApplicationApproveByOrderId,
getBatchFeeByProcessId,
qetBatchFeeByBusinessId,
getBatchFeeByBusinessId,
getBatchFeeByBusinessId, feeApplicationDelete,
} from "@/api/ecw/order";
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import {getDictDatas, DICT_TYPE} from "@/utils/dict";
import workFlow from "@/components/WorkFlow";
export default {
name: "feeApplication",
components: { workFlow },
components: {workFlow},
props: {
orderId: [Number, String],
dialogVisible: {
......@@ -234,7 +257,7 @@ export default {
});
// 查询历史申请
feeApplicationListByOrderId({ orderId: this.orderId }).then((res) => {
feeApplicationListByOrderId({orderId: this.orderId}).then((res) => {
this.list = res.data;
});
......@@ -270,6 +293,17 @@ export default {
status: 0,
});
},
deleteByFeeIsZero(id) {
this.$confirm(this.$t("确定要删除此条费用申请么?")).then(() => {
feeApplicationDelete(id).then((r) => {
this.$message({
type: "success",
message: this.$t("删除成功"),
});
this.$emit("update:dialogVisible", false);
});
});
},
submit() {
// 判断费用申请是否有未填项
const errList = this.feeList.filter((item) => {
......@@ -319,7 +353,7 @@ export default {
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
})
.then(({ value }) => {
.then(({value}) => {
let item = this.list.find((e) => e.status === 1);
feeApplicationCancel({
huifu: value,
......@@ -332,7 +366,8 @@ export default {
this.$emit("update:dialogVisible", false);
});
})
.catch(() => {});
.catch(() => {
});
},
},
watch: {
......@@ -353,14 +388,17 @@ export default {
<style scoped lang="scss">
.fee-application {
padding: 0 20px;
h1 {
font-weight: 600;
font-size: 20px;
}
.content {
width: 200px;
}
}
.my-process-designer {
height: calc(100vh - 200px);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment