|
@@ -3,7 +3,7 @@
|
|
|
<byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
|
|
|
<template #supplyId>
|
|
|
<div style="width: 100%">
|
|
|
- <el-form-item prop="supplyId" label="供应商">
|
|
|
+ <el-form-item prop="supplyId" label="供应商" class="margin-b-0">
|
|
|
<el-select v-model="formData.data.supplyId" filterable remote reserve-keyword placeholder="请输入关键字" remote-show-suffix
|
|
|
:remote-method="remoteMethod" :loading="loadingSearch" @input="remoteMethod" style="width: 100%" @change="changeSupply" v-if="
|
|
|
[30].includes(route.query.processType) ||
|
|
@@ -16,31 +16,7 @@
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <template #deadline>
|
|
|
- <div style="width: 100%">
|
|
|
- <el-date-picker v-model="formData.data.deadline" type="date" placeholder="请选择付款期限" value-format="YYYY-MM-DD" style="width: 100%" />
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template #receiptsNum>
|
|
|
- <div style="width: 100%">
|
|
|
- <el-input-number onmousewheel="return false;" v-model="formData.data.receiptsNum" placeholder="请输入单据数量" :min="0" :precision="0"
|
|
|
- :controls="false" style="width: 100%" />
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template #taxRate>
|
|
|
- <div style="width: 100%">
|
|
|
- <el-input-number onmousewheel="return false;" v-model="formData.data.taxRate" placeholder="请输入税率" :min="0" :max="100" :precision="2"
|
|
|
- :controls="false" style="width: 100%" />
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template #fileList>
|
|
|
- <div style="width: 100%">
|
|
|
- <el-upload v-model:fileList="fileList" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" multiple :data="uploadData"
|
|
|
- :before-upload="uploadFile" :on-preview="onPreviewFile">
|
|
|
- <el-button>选择</el-button>
|
|
|
- </el-upload>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+
|
|
|
<template #payDetailList>
|
|
|
<div style="width: 100%">
|
|
|
<el-button type="primary" @click="clickAdd()">添加行</el-button>
|
|
@@ -48,7 +24,7 @@
|
|
|
<el-table-column label="采购合同" width="220">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
- <el-form-item :prop="'payDetailList.' + $index + '.purchaseId'" :rules="rules.purchaseId" :inline-message="true">
|
|
|
+ <el-form-item :prop="'payDetailList.' + $index + '.purchaseId'" :rules="rules.purchaseId" :inline-message="true" class="margin-b-0">
|
|
|
<el-select v-model="row.purchaseId" placeholder="请选择采购合同" filterable style="width: 100%" @change="changePurchaseId(row, true)">
|
|
|
<el-option v-for="item in contractList" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
@@ -62,7 +38,7 @@
|
|
|
<el-table-column label="款项说明">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
- <el-form-item :prop="'payDetailList.' + $index + '.remark'" :rules="rules.remark" :inline-message="true">
|
|
|
+ <el-form-item :prop="'payDetailList.' + $index + '.remark'" :rules="rules.remark" :inline-message="true" class="margin-b-0">
|
|
|
<el-input v-model="row.remark" placeholder="请输入款项说明" style="width: 100%" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
@@ -71,7 +47,7 @@
|
|
|
<el-table-column label="付款金额" width="180">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
- <el-form-item :prop="'payDetailList.' + $index + '.money'" :rules="rules.money" :inline-message="true">
|
|
|
+ <el-form-item :prop="'payDetailList.' + $index + '.money'" :rules="rules.money" :inline-message="true" class="margin-b-0">
|
|
|
<el-input-number onmousewheel="return false;" v-model="row.money" placeholder="请输入金额" style="width: 100%" :precision="2"
|
|
|
:controls="false" :min="0" @change="changeMoney()" />
|
|
|
</el-form-item>
|
|
@@ -97,12 +73,16 @@ import { ElMessage } from "element-plus";
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
import { useRoute } from "vue-router";
|
|
|
import { async } from "@antv/x6/lib/registry/marker/async";
|
|
|
-const userInfo = useUserStore();
|
|
|
const route = useRoute();
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
+const invoiceType = computed(
|
|
|
+ () => proxy.useUserStore().allDict["invoice_type"]
|
|
|
+);
|
|
|
+const fundsPaymentMethod = computed(
|
|
|
+ () => proxy.useUserStore().allDict["funds_payment_method"]
|
|
|
+);
|
|
|
+const payMethod = computed(() => proxy.useUserStore().allDict["pay_method"]);
|
|
|
const supplierList = ref([]);
|
|
|
-const invoiceType = ref([]);
|
|
|
-const fundsPaymentMethod = ref([]);
|
|
|
const accountList = ref([]);
|
|
|
const contractList = ref([]);
|
|
|
let formData = reactive({
|
|
@@ -112,7 +92,7 @@ let formData = reactive({
|
|
|
invoiceType: "",
|
|
|
remark: "",
|
|
|
deadline: "",
|
|
|
- receiptsNum: undefined,
|
|
|
+ receiptsNum: null,
|
|
|
payType: "",
|
|
|
currency: "",
|
|
|
accountManagementId: "",
|
|
@@ -121,7 +101,7 @@ let formData = reactive({
|
|
|
fileList: [],
|
|
|
advanceCode: "",
|
|
|
type: "",
|
|
|
- taxRate: undefined,
|
|
|
+ taxRate: null,
|
|
|
},
|
|
|
});
|
|
|
const submit = ref(null);
|
|
@@ -139,12 +119,10 @@ const judgeStatus = () => {
|
|
|
}
|
|
|
return false;
|
|
|
};
|
|
|
-const payMethod = ref([]);
|
|
|
const formOption = reactive({
|
|
|
inline: true,
|
|
|
labelWidth: 100,
|
|
|
itemWidth: 100,
|
|
|
- rules: [],
|
|
|
disabled: false,
|
|
|
});
|
|
|
const formConfig = computed(() => {
|
|
@@ -158,20 +136,21 @@ const formConfig = computed(() => {
|
|
|
type: "slot",
|
|
|
slotName: "supplyId",
|
|
|
label: "",
|
|
|
+ itemWidth: 33.33,
|
|
|
},
|
|
|
{
|
|
|
- type: "slot",
|
|
|
+ type: "date",
|
|
|
prop: "deadline",
|
|
|
- slotName: "deadline",
|
|
|
+ itemType: "date",
|
|
|
label: "付款期限",
|
|
|
- itemWidth: 33,
|
|
|
+ itemWidth: 33.33,
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
label: "付款类型",
|
|
|
prop: "type",
|
|
|
data: payMethod.value,
|
|
|
- itemWidth: 33,
|
|
|
+ itemWidth: 33.33,
|
|
|
style: "width: 100%",
|
|
|
fn: () => {
|
|
|
formData.data.advanceCode = "";
|
|
@@ -193,11 +172,13 @@ const formConfig = computed(() => {
|
|
|
itemType: "textarea",
|
|
|
},
|
|
|
{
|
|
|
- type: "slot",
|
|
|
+ type: "number",
|
|
|
prop: "receiptsNum",
|
|
|
- slotName: "receiptsNum",
|
|
|
label: "单据数量",
|
|
|
- itemWidth: 33,
|
|
|
+ precision: 0,
|
|
|
+ min: 0,
|
|
|
+ controls: false,
|
|
|
+ itemWidth: 33.33,
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
@@ -217,18 +198,21 @@ const formConfig = computed(() => {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- type: "slot",
|
|
|
+ type: "number",
|
|
|
prop: "taxRate",
|
|
|
- slotName: "taxRate",
|
|
|
label: "税率 (%)",
|
|
|
- itemWidth: 34,
|
|
|
+ precision: 2,
|
|
|
+ min: 0,
|
|
|
+ controls: false,
|
|
|
+ itemWidth: 33.33,
|
|
|
isShow:
|
|
|
formData.data.invoiceType == "1" || formData.data.invoiceType == "2",
|
|
|
},
|
|
|
{
|
|
|
- type: "slot",
|
|
|
+ type: "upload",
|
|
|
+ listType: "text",
|
|
|
+ accept: "",
|
|
|
prop: "fileList",
|
|
|
- slotName: "fileList",
|
|
|
label: "上传附件",
|
|
|
},
|
|
|
{
|
|
@@ -249,9 +233,8 @@ const formConfig = computed(() => {
|
|
|
required: true,
|
|
|
itemType: "text",
|
|
|
disabled: true,
|
|
|
- itemWidth: 50,
|
|
|
+ itemWidth: 33.33,
|
|
|
},
|
|
|
-
|
|
|
{
|
|
|
type: "title",
|
|
|
title: "收款信息",
|
|
@@ -326,60 +309,8 @@ const rules = ref({
|
|
|
type: [{ required: true, message: "请选择付款类型", trigger: "change" }],
|
|
|
taxRate: [{ required: true, message: "请输入税率", trigger: "blur" }],
|
|
|
});
|
|
|
-const fileList = ref([]);
|
|
|
-const uploadData = ref({});
|
|
|
+
|
|
|
const getDict = () => {
|
|
|
- proxy
|
|
|
- .post("/dictTenantData/page", {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 999,
|
|
|
- dictCode: "invoice_type",
|
|
|
- tenantId: useUserStore().user.tenantId,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.rows && res.rows.length > 0) {
|
|
|
- invoiceType.value = res.rows.map((item) => {
|
|
|
- return {
|
|
|
- label: item.dictValue,
|
|
|
- value: item.dictKey,
|
|
|
- };
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- proxy
|
|
|
- .post("/dictTenantData/page", {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 999,
|
|
|
- dictCode: "funds_payment_method",
|
|
|
- tenantId: useUserStore().user.tenantId,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.rows && res.rows.length > 0) {
|
|
|
- fundsPaymentMethod.value = res.rows.map((item) => {
|
|
|
- return {
|
|
|
- label: item.dictValue,
|
|
|
- value: item.dictKey,
|
|
|
- };
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- proxy
|
|
|
- .post("/dictTenantData/page", {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 999,
|
|
|
- dictCode: "pay_method",
|
|
|
- tenantId: useUserStore().user.tenantId,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.rows && res.rows.length > 0) {
|
|
|
- payMethod.value = res.rows.map((item) => {
|
|
|
- return {
|
|
|
- label: item.dictValue,
|
|
|
- value: item.dictKey,
|
|
|
- };
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
proxy.post("/supplierInfo/page", { pageNum: 1, pageSize: 50 }).then((res) => {
|
|
|
if (res.rows && res.rows.length > 0) {
|
|
|
supplierList.value = res.rows.map((item) => {
|
|
@@ -391,6 +322,7 @@ const getDict = () => {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
proxy
|
|
|
.post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
|
|
|
.then((res) => {
|
|
@@ -407,17 +339,7 @@ const getDict = () => {
|
|
|
});
|
|
|
};
|
|
|
getDict();
|
|
|
-const uploadFile = async (file) => {
|
|
|
- const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
|
|
|
- uploadData.value = res.uploadBody;
|
|
|
- file.id = res.id;
|
|
|
- file.fileName = res.fileName;
|
|
|
- file.fileUrl = res.fileUrl;
|
|
|
- return true;
|
|
|
-};
|
|
|
-const onPreviewFile = (file) => {
|
|
|
- window.open(file.raw.fileUrl, "_blank");
|
|
|
-};
|
|
|
+
|
|
|
const changeSupply = async (val) => {
|
|
|
if (val) {
|
|
|
await proxy
|
|
@@ -502,15 +424,6 @@ const handleSubmit = async () => {
|
|
|
let status = await submit.value.handleSubmit(() => {});
|
|
|
if (status) {
|
|
|
if (formData.data.payDetailList && formData.data.payDetailList.length > 0) {
|
|
|
- if (fileList.value && fileList.value.length > 0) {
|
|
|
- formData.data.fileList = fileList.value.map((item) => {
|
|
|
- return {
|
|
|
- id: item.raw.id,
|
|
|
- fileName: item.raw.fileName,
|
|
|
- fileUrl: item.raw.fileUrl,
|
|
|
- };
|
|
|
- });
|
|
|
- }
|
|
|
return true;
|
|
|
} else {
|
|
|
ElMessage("请添加至少一条付款明细");
|
|
@@ -523,16 +436,6 @@ const handleSubmit = async () => {
|
|
|
const props = defineProps({
|
|
|
queryData: Object,
|
|
|
});
|
|
|
-// 判断当前用户有无销售合同页面权限
|
|
|
-const isHave = ref(false);
|
|
|
-if (userInfo.permissions && userInfo.permissions.includes("contract")) {
|
|
|
- isHave.value = true;
|
|
|
-}
|
|
|
-// 判断当前用户有无采购合同页面权限
|
|
|
-const isHaveOne = ref(false);
|
|
|
-if (userInfo.permissions && userInfo.permissions.includes("alreadyPurchase")) {
|
|
|
- isHaveOne.value = true;
|
|
|
-}
|
|
|
|
|
|
onMounted(async () => {
|
|
|
if (props.queryData.supplyIdTwo) {
|
|
@@ -608,12 +511,11 @@ onMounted(async () => {
|
|
|
) {
|
|
|
formData.data.fileList = fileObj[route.query.businessId].map(
|
|
|
(x) => ({
|
|
|
- raw: x,
|
|
|
+ ...x,
|
|
|
name: x.fileName,
|
|
|
url: x.fileUrl,
|
|
|
})
|
|
|
);
|
|
|
- fileList.value = formData.data.fileList;
|
|
|
}
|
|
|
});
|
|
|
});
|
|
@@ -643,6 +545,7 @@ let auxiliaryData = ref([
|
|
|
]);
|
|
|
const emit = defineEmits(["auxiliaryChange"]);
|
|
|
const getDecisionAids = () => {
|
|
|
+ return;
|
|
|
let data = {
|
|
|
purchaseIdList: [],
|
|
|
};
|
|
@@ -792,7 +695,4 @@ const remoteMethod = (keyword) => {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-::v-deep(.el-input-number .el-input__inner) {
|
|
|
- text-align: left;
|
|
|
-}
|
|
|
</style>
|