|
@@ -2,156 +2,82 @@
|
|
|
<div class="tenant">
|
|
|
<!-- <Banner /> -->
|
|
|
<div class="content">
|
|
|
- <byTable
|
|
|
- :source="sourceList.data"
|
|
|
- :pagination="sourceList.pagination"
|
|
|
- :config="config"
|
|
|
- :loading="loading"
|
|
|
- highlight-current-row
|
|
|
- :selectConfig="selectConfig"
|
|
|
- :table-events="{
|
|
|
+ <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
|
|
|
+ :selectConfig="selectConfig" :table-events="{
|
|
|
//element talbe事件都能传
|
|
|
select: selectRow,
|
|
|
- }"
|
|
|
- :action-list="[
|
|
|
+ }" :action-list="[
|
|
|
+ {
|
|
|
+ text: '导出Excel',
|
|
|
+ disabled: false,
|
|
|
+ action: () => deriveExcel(),
|
|
|
+ },
|
|
|
{
|
|
|
text: '合并付款',
|
|
|
disabled: selectData.length === 0,
|
|
|
action: () => handlePayment(20),
|
|
|
},
|
|
|
- ]"
|
|
|
- @get-list="getList"
|
|
|
- >
|
|
|
- <!-- {
|
|
|
- text: '导出Excel',
|
|
|
- disabled: false,
|
|
|
- action: () => deriveExcel(),
|
|
|
- }, -->
|
|
|
+
|
|
|
+ ]" @get-list="getList" @moreSearch="() => (dialogVisibleFour = true)">
|
|
|
+
|
|
|
<template #contractCode="{ item }">
|
|
|
- <div
|
|
|
- style="cursor: pointer; color: #409eff"
|
|
|
- @click="handleClickContractCode(item)"
|
|
|
- >
|
|
|
+ <div style="cursor: pointer; color: #409eff" @click="handleClickContractCode(item)">
|
|
|
{{ item.contractCode }}
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <template #waitRefundAmount="{ item }">
|
|
|
+ <div style="cursor: pointer; color: #409eff" @click="handleRefund(item,'1')">
|
|
|
+ {{ item.waitRefundAmount }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
|
|
|
<template #arrivalStatus="{ item }">
|
|
|
- <div
|
|
|
- style="cursor: pointer; color: #409eff"
|
|
|
- @click="handleClickArrivalStatus(item)"
|
|
|
- >
|
|
|
+ <div style="cursor: pointer; color: #409eff" @click="handleClickArrivalStatus(item)">
|
|
|
{{ dictValueLabel(item.arrivalStatus, arrivalStatus) }}
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<template #payStatus="{ item }">
|
|
|
- <div
|
|
|
- style="cursor: pointer; color: #409eff"
|
|
|
- @click="handleClickPayStatus(item)"
|
|
|
- >
|
|
|
+ <div style="cursor: pointer; color: #409eff" @click="handleClickPayStatus(item)">
|
|
|
{{ dictValueLabel(item.payStatus, paymentStatus) }}
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<template #btn="{ item }">
|
|
|
<div>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- v-if="item.payStatus != 0"
|
|
|
- link
|
|
|
- @click="handleRefund(item)"
|
|
|
- >退款</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- link
|
|
|
- v-if="item.payStatus != 30"
|
|
|
- @click="handlePayment(10, item)"
|
|
|
- >付款</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- link
|
|
|
- v-if="item.payStatus != 30"
|
|
|
- @click="handleEnd(item)"
|
|
|
- >结束</el-button
|
|
|
- >
|
|
|
- <el-button type="primary" link @click="handleClear(item)"
|
|
|
- >清空</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" v-if="item.payStatus != 0" link @click="handleRefund(item,'')">退款</el-button>
|
|
|
+ <el-button type="primary" link v-if="item.payStatus != 30" @click="handlePayment(10, item)">付款</el-button>
|
|
|
+ <el-button type="primary" link v-if="item.payStatus != 30" @click="handleEnd(item)">结束</el-button>
|
|
|
+ <el-button type="primary" link @click="handleClear(item)">清空</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</byTable>
|
|
|
</div>
|
|
|
- <el-dialog
|
|
|
- :title="'付款'"
|
|
|
- v-model="dialogVisible"
|
|
|
- width="80%"
|
|
|
- v-loading="submitLoading"
|
|
|
- destroy-on-close
|
|
|
- :before-close="handleClose"
|
|
|
- >
|
|
|
- <byForm
|
|
|
- :formConfig="formConfig"
|
|
|
- :formOption="formOption"
|
|
|
- v-model="formData.data"
|
|
|
- :rules="rules"
|
|
|
- ref="byform"
|
|
|
- >
|
|
|
+ <el-dialog :title="'付款'" v-model="dialogVisible" width="80%" v-loading="submitLoading" destroy-on-close :before-close="handleClose">
|
|
|
+ <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
|
|
|
<template #details>
|
|
|
<div style="width: 100%">
|
|
|
- <el-table
|
|
|
- :data="formData.data.purchasePayRecordDetailList"
|
|
|
- show-summary
|
|
|
- :summary-method="getSummaries"
|
|
|
- >
|
|
|
+ <el-table :data="formData.data.purchasePayRecordDetailList" show-summary :summary-method="getSummaries">
|
|
|
<el-table-column prop="code" label="采购单号" />
|
|
|
- <el-table-column
|
|
|
- prop="isAgreement"
|
|
|
- label="是否合同"
|
|
|
- :formatter="(row) => (row.isAgreement == 1 ? '是' : '否')"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="paymentMethod"
|
|
|
- label="付款方式"
|
|
|
- :formatter="
|
|
|
+ <el-table-column prop="isAgreement" label="是否合同" :formatter="(row) => (row.isAgreement == 1 ? '是' : '否')" />
|
|
|
+ <el-table-column prop="paymentMethod" label="付款方式" :formatter="
|
|
|
(row) => dictValueLabel(row.paymentMethod, fundsPaymentMethod)
|
|
|
- "
|
|
|
- />
|
|
|
+ " />
|
|
|
<el-table-column prop="remark" label="采购备注" />
|
|
|
<el-table-column prop="waitAmount" label="采购金额" />
|
|
|
<el-table-column prop="alreadyAmount" label="已付款金额" />
|
|
|
<el-table-column prop="amount" label="付款金额" min-width="150">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-form-item
|
|
|
- :prop="'purchasePayRecordDetailList.' + $index + '.amount'"
|
|
|
- :rules="rules.amount"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
- <el-input-number
|
|
|
- v-model="row.amount"
|
|
|
- :precision="4"
|
|
|
- :controls="false"
|
|
|
- :min="0"
|
|
|
- onmousewheel="return false;"
|
|
|
- @change="handleChangeAmount"
|
|
|
- />
|
|
|
+ <el-form-item :prop="'purchasePayRecordDetailList.' + $index + '.amount'" :rules="rules.amount" :inline-message="true">
|
|
|
+ <el-input-number v-model="row.amount" :precision="4" :controls="false" :min="0" onmousewheel="return false;"
|
|
|
+ @change="handleChangeAmount" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="remark" label="备注" min-width="150">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-form-item
|
|
|
- :prop="'purchasePayRecordDetailList.' + $index + '.remark'"
|
|
|
- :rules="rules.remark"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="row.remark"
|
|
|
- placeholder="请输入"
|
|
|
- type="textarea"
|
|
|
- />
|
|
|
+ <el-form-item :prop="'purchasePayRecordDetailList.' + $index + '.remark'" :rules="rules.remark" :inline-message="true">
|
|
|
+ <el-input v-model="row.remark" placeholder="请输入" type="textarea" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -160,15 +86,8 @@
|
|
|
</template>
|
|
|
<template #file>
|
|
|
<div style="width: 100%">
|
|
|
- <el-upload
|
|
|
- v-model:fileList="formData.data.fileList"
|
|
|
- action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
|
- :data="uploadData"
|
|
|
- multiple
|
|
|
- :before-upload="uploadFile"
|
|
|
- :on-success="handleSuccess"
|
|
|
- :on-preview="onPreviewFile"
|
|
|
- >
|
|
|
+ <el-upload v-model:fileList="formData.data.fileList" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" :data="uploadData"
|
|
|
+ multiple :before-upload="uploadFile" :on-success="handleSuccess" :on-preview="onPreviewFile">
|
|
|
<el-button type="primary" plain>选择</el-button>
|
|
|
</el-upload>
|
|
|
</div>
|
|
@@ -176,75 +95,35 @@
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
|
<el-button @click="handleClose" size="large">取 消</el-button>
|
|
|
- <el-button
|
|
|
- v-if="modalType == 'add'"
|
|
|
- type="primary"
|
|
|
- @click="submitForm('byform')"
|
|
|
- size="large"
|
|
|
- :loading="submitLoading"
|
|
|
- >
|
|
|
+ <el-button v-if="modalType == 'add'" type="primary" @click="submitForm('byform')" size="large" :loading="submitLoading">
|
|
|
确 定
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
- <el-dialog
|
|
|
- :title="'退款'"
|
|
|
- v-model="dialogVisibleTwo"
|
|
|
- width="800"
|
|
|
- v-loading="submitLoading"
|
|
|
- destroy-on-close
|
|
|
- >
|
|
|
- <byForm
|
|
|
- :formConfig="formConfigOne"
|
|
|
- :formOption="formOption"
|
|
|
- v-model="formData.dataOne"
|
|
|
- :rules="rulesOne"
|
|
|
- ref="byformOne"
|
|
|
- >
|
|
|
+ <el-dialog :title="'退款'" v-model="dialogVisibleTwo" width="800" v-loading="submitLoading" destroy-on-close>
|
|
|
+ <byForm :formConfig="formConfigOne" :formOption="formOption" v-model="formData.dataOne" :rules="rulesOne" ref="byformOne">
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
|
- <el-button @click="dialogVisibleTwo = false" size="large"
|
|
|
- >取 消</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- v-if="modalType == 'add'"
|
|
|
- type="primary"
|
|
|
- @click="submitFormOne()"
|
|
|
- size="large"
|
|
|
- :loading="submitLoading"
|
|
|
- >
|
|
|
+ <el-button @click="dialogVisibleTwo = false" size="large">取 消</el-button>
|
|
|
+ <el-button v-if="modalType == 'add'" type="primary" @click="submitFormOne()" size="large" :loading="submitLoading">
|
|
|
确 定
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog
|
|
|
- v-model="dialogVisibleOne"
|
|
|
- title="交易记录"
|
|
|
- width="500"
|
|
|
- append-to-body
|
|
|
- destroy-on-close
|
|
|
- >
|
|
|
+ <el-dialog v-model="dialogVisibleOne" title="交易记录" width="500" append-to-body destroy-on-close>
|
|
|
<div>
|
|
|
<el-timeline :reverse="false">
|
|
|
- <el-timeline-item
|
|
|
- placement="top"
|
|
|
- v-for="(activity, index) in activities"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
- <div
|
|
|
- style="
|
|
|
+ <el-timeline-item placement="top" v-for="(activity, index) in activities" :key="index">
|
|
|
+ <div style="
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
- "
|
|
|
- >
|
|
|
+ ">
|
|
|
<div style="color: #909399">
|
|
|
{{ activity.payUserName }}
|
|
|
</div>
|
|
|
- <el-button type="primary" plain @click="handleGetDtl(activity)"
|
|
|
- >查看详情</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" plain @click="handleGetDtl(activity)">查看详情</el-button>
|
|
|
</div>
|
|
|
<div v-if="activity.type == '1'">
|
|
|
<div style="margin-top: 5px">
|
|
@@ -282,15 +161,9 @@
|
|
|
退款备注: {{ activity.remark }}
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div
|
|
|
- style="width: 100%; margin-top: 5px"
|
|
|
- v-if="activity.fileList && activity.fileList.length > 0"
|
|
|
- >
|
|
|
+ <div style="width: 100%; margin-top: 5px" v-if="activity.fileList && activity.fileList.length > 0">
|
|
|
<div v-for="(item, index) in activity.fileList" :key="index">
|
|
|
- <div
|
|
|
- style="cursor: pointer; color: #409eff"
|
|
|
- @click="openFile(item)"
|
|
|
- >
|
|
|
+ <div style="cursor: pointer; color: #409eff" @click="openFile(item)">
|
|
|
{{ item.fileName }}
|
|
|
</div>
|
|
|
</div>
|
|
@@ -302,21 +175,23 @@
|
|
|
<el-button @click="dialogVisibleOne = false">关闭</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog :title="'高级检索'" v-model="dialogVisibleFour" width="500px" destroy-on-close>
|
|
|
+ <el-form :model="sourceList.pagination" label-width="100px" label-position="top">
|
|
|
+ <el-form-item label="采购时间">
|
|
|
+ <el-date-picker v-model="sourceList.pagination.arr" type="daterange" range-separator="到" start-placeholder="请选择" end-placeholder="请选择"
|
|
|
+ value-format="YYYY-MM-DD HH:mm:ss" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="handleReset" size="large">重置</el-button>
|
|
|
+ <el-button @click="handleQuery" type="primary" size="large">搜索</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
- <el-dialog
|
|
|
- :title="'到货详情'"
|
|
|
- v-model="dialogVisibleThree"
|
|
|
- width="80%"
|
|
|
- destroy-on-close
|
|
|
- >
|
|
|
- <ArrivalDetails
|
|
|
- :purchaseRow="currnetPurchaseRow"
|
|
|
- @handleClickStatus="handleClickStatus"
|
|
|
- ></ArrivalDetails>
|
|
|
+ <el-dialog :title="'到货详情'" v-model="dialogVisibleThree" width="80%" destroy-on-close>
|
|
|
+ <ArrivalDetails :purchaseRow="currnetPurchaseRow" @handleClickStatus="handleClickStatus"></ArrivalDetails>
|
|
|
<template #footer>
|
|
|
- <el-button @click="dialogVisibleThree = false" size="large"
|
|
|
- >取 消</el-button
|
|
|
- >
|
|
|
+ <el-button @click="dialogVisibleThree = false" size="large">取 消</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -340,6 +215,7 @@ const sourceList = ref({
|
|
|
type: "",
|
|
|
keyword: "",
|
|
|
purchaseStatus: "30,99",
|
|
|
+ arr: [],
|
|
|
},
|
|
|
});
|
|
|
let dialogVisible = ref(false);
|
|
@@ -485,6 +361,16 @@ const config = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
+ label: "待退款金额",
|
|
|
+ slot: "waitRefundAmount",
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ // render(refundAmount) {
|
|
|
+ // return proxy.moneyFormat(refundAmount, 2);
|
|
|
+ // },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
label: "采购人",
|
|
|
prop: "purchaseName",
|
|
|
width: 150,
|
|
@@ -629,6 +515,16 @@ let formConfigOne = computed(() => [
|
|
|
},
|
|
|
{
|
|
|
type: "number",
|
|
|
+ prop: "waitRefundAmount",
|
|
|
+ label: "待退款金额",
|
|
|
+ precision: 4,
|
|
|
+ min: 0,
|
|
|
+ controls: false,
|
|
|
+ isShow: refundType.value == "1",
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "number",
|
|
|
prop: "amount",
|
|
|
label: "退款金额",
|
|
|
precision: 4,
|
|
@@ -715,6 +611,14 @@ const submitFormOne = () => {
|
|
|
type: "info",
|
|
|
});
|
|
|
}
|
|
|
+ if (refundType.value == "1") {
|
|
|
+ if (formData.dataOne.amount > formData.dataOne.waitRefundAmount) {
|
|
|
+ return ElMessage({
|
|
|
+ message: "退款金额不能大于待退款金额",
|
|
|
+ type: "info",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
submitLoading.value = true;
|
|
|
proxy.post("/purchaseRefundRecord/add", formData.dataOne).then(
|
|
|
(res) => {
|
|
@@ -798,10 +702,13 @@ const handlePayment = (type, data) => {
|
|
|
};
|
|
|
dialogVisible.value = true;
|
|
|
};
|
|
|
-
|
|
|
-const handleRefund = (row) => {
|
|
|
+const refundType = ref("");
|
|
|
+const handleRefund = (row, type) => {
|
|
|
formOption.disabled = false;
|
|
|
+ modalType.value = "add";
|
|
|
+ refundType.value = type;
|
|
|
formData.dataOne = {
|
|
|
+ refundType: type,
|
|
|
type: "2",
|
|
|
purchaseId: row.id,
|
|
|
supplyName: row.supplyName,
|
|
@@ -810,6 +717,9 @@ const handleRefund = (row) => {
|
|
|
refundDate: "",
|
|
|
remark: "",
|
|
|
};
|
|
|
+ if (type == "1") {
|
|
|
+ formData.dataOne.waitRefundAmount = row.waitRefundAmount;
|
|
|
+ }
|
|
|
dialogVisibleTwo.value = true;
|
|
|
};
|
|
|
const currentRow = ref({});
|
|
@@ -970,6 +880,7 @@ const openFile = (item) => {
|
|
|
};
|
|
|
|
|
|
const handleGetDtl = (row) => {
|
|
|
+ refundType.value = "";
|
|
|
if (row.type == "1") {
|
|
|
modalType.value = "edit";
|
|
|
formOption.disabled = true;
|
|
@@ -1084,11 +995,34 @@ const getSummaries = (param) => {
|
|
|
});
|
|
|
return sums;
|
|
|
};
|
|
|
+const dialogVisibleFour = ref(false);
|
|
|
|
|
|
const currnetPurchaseRow = ref({});
|
|
|
const handleClickArrivalStatus = (row) => {
|
|
|
currnetPurchaseRow.value = { ...row };
|
|
|
- dialogVisibleThree.value = true;
|
|
|
+ dialogVisibleFour.value = true;
|
|
|
+};
|
|
|
+
|
|
|
+const handleQuery = () => {
|
|
|
+ if (
|
|
|
+ sourceList.value.pagination.arr &&
|
|
|
+ sourceList.value.pagination.arr.length > 1
|
|
|
+ ) {
|
|
|
+ sourceList.value.pagination.purchaseStartTime =
|
|
|
+ sourceList.value.pagination.arr[0];
|
|
|
+ sourceList.value.pagination.purchaseEndTime =
|
|
|
+ sourceList.value.pagination.arr[1];
|
|
|
+ }
|
|
|
+ dialogVisibleFour.value = false;
|
|
|
+ getList();
|
|
|
+};
|
|
|
+const handleReset = () => {
|
|
|
+ sourceList.value.pagination = {
|
|
|
+ pageNum: sourceList.value.pagination.pageNum,
|
|
|
+ pageSize: sourceList.value.pagination.pageSize,
|
|
|
+ arr: [],
|
|
|
+ };
|
|
|
+ handleQuery();
|
|
|
};
|
|
|
</script>
|
|
|
|