|
@@ -44,9 +44,29 @@
|
|
<byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data">
|
|
<byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data">
|
|
<template #orderIdList>
|
|
<template #orderIdList>
|
|
<div style="width: 100%">
|
|
<div style="width: 100%">
|
|
- <div style="margin-bottom: 10px">
|
|
|
|
- <el-button type="primary" size="small" @click="clickAddContract()">选择合同</el-button>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <el-form-item label="事业部" prop="departmentId" style="margin-bottom: 18px">
|
|
|
|
+ <el-select v-model="formData.data.departmentId" placeholder="请选择事业部" clearable @change="changeDepartment">
|
|
|
|
+ <el-option v-for="item in departmentList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
|
|
|
|
+ </el-select>
|
|
|
|
+ <el-button type="primary" size="small" style="margin-left: 16px" @click="clickAddOrder()">选择合同</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-table :data="formData.data.orderList" :row-style="{ height: '35px' }" header-row-class-name="tableHeader">
|
|
|
|
+ <el-table-column label="事业部" prop="departmentName" width="140" />
|
|
|
|
+ <el-table-column label="订单号" prop="code" min-width="180" />
|
|
|
|
+ <el-table-column label="万里牛单号" prop="wlnCode" width="150" />
|
|
|
|
+ <el-table-column label="订单总金额 ¥" prop="totalAmount" align="right" width="120" />
|
|
|
|
+ <el-table-column label="产品总金额 ¥" prop="productTotalAmount" align="right" width="120" />
|
|
|
|
+ <el-table-column label="定制加工费 ¥" prop="customProcessingFee" align="right" width="110" />
|
|
|
|
+ <el-table-column label="代发费 ¥" prop="lssueFee" align="right" width="100" />
|
|
|
|
+ <el-table-column label="快递包材费 ¥" prop="deliveryMaterialsFee" align="right" width="110" />
|
|
|
|
+ <el-table-column label="包装人工费 ¥" prop="packingLabor" align="right" width="110" />
|
|
|
|
+ <el-table-column label="包材费 ¥" prop="packagingMaterialCost" align="right" width="100" />
|
|
|
|
+ <el-table-column label="操作" align="center" fixed="right" width="60">
|
|
|
|
+ <template #default="{ $index }">
|
|
|
|
+ <el-button type="primary" @click="clickOrderDelete($index)" text>删除</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</byForm>
|
|
</byForm>
|
|
@@ -58,7 +78,7 @@
|
|
|
|
|
|
<el-dialog title="上传对账单" v-if="openReceiptFile" v-model="openReceiptFile" width="600">
|
|
<el-dialog title="上传对账单" v-if="openReceiptFile" v-model="openReceiptFile" width="600">
|
|
<el-upload
|
|
<el-upload
|
|
- v-model:fileList="formReceiptData.data.fileList"
|
|
|
|
|
|
+ v-model:fileList="fileList"
|
|
action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
:data="uploadReceiptData"
|
|
:data="uploadReceiptData"
|
|
multiple
|
|
multiple
|
|
@@ -75,7 +95,7 @@
|
|
|
|
|
|
<el-dialog title="上传转账凭证" v-if="openProofFile" v-model="openProofFile" width="600">
|
|
<el-dialog title="上传转账凭证" v-if="openProofFile" v-model="openProofFile" width="600">
|
|
<el-upload
|
|
<el-upload
|
|
- v-model:fileList="formProofData.data.fileList"
|
|
|
|
|
|
+ v-model:fileList="fileList"
|
|
action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
:data="uploadProofData"
|
|
:data="uploadProofData"
|
|
multiple
|
|
multiple
|
|
@@ -89,13 +109,21 @@
|
|
<el-button type="primary" @click="submitProofFile()" size="large" v-preReClick>确 定</el-button>
|
|
<el-button type="primary" @click="submitProofFile()" size="large" v-preReClick>确 定</el-button>
|
|
</template>
|
|
</template>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+
|
|
|
|
+ <el-dialog title="选择合同" v-if="openOrder" v-model="openOrder" width="90%">
|
|
|
|
+ <SelectOrder :selectStatus="true" :departmentId="formData.data.departmentId" @selectOrder="selectOrder"></SelectOrder>
|
|
|
|
+ <template #footer>
|
|
|
|
+ <el-button @click="openOrder = false" size="large">关 闭</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
-<script setup>
|
|
|
|
|
|
+<script setup name="Check-bill">
|
|
import byTable from "@/components/byTable/index";
|
|
import byTable from "@/components/byTable/index";
|
|
import byForm from "@/components/byForm/index";
|
|
import byForm from "@/components/byForm/index";
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
|
+import SelectOrder from "@/views/group/order/management/index";
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
const { proxy } = getCurrentInstance();
|
|
const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
|
|
const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
|
|
@@ -196,13 +224,13 @@ const config = computed(() => {
|
|
return [
|
|
return [
|
|
{
|
|
{
|
|
attrs: {
|
|
attrs: {
|
|
- label: "下载",
|
|
|
|
|
|
+ label: "打印",
|
|
type: "primary",
|
|
type: "primary",
|
|
text: true,
|
|
text: true,
|
|
},
|
|
},
|
|
el: "button",
|
|
el: "button",
|
|
click() {
|
|
click() {
|
|
- clickUpdate(row);
|
|
|
|
|
|
+ clickPrint(row);
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -301,20 +329,72 @@ const clickModal = () => {
|
|
departmentId: "",
|
|
departmentId: "",
|
|
amount: "",
|
|
amount: "",
|
|
orderIdList: [],
|
|
orderIdList: [],
|
|
|
|
+ orderList: [],
|
|
};
|
|
};
|
|
openDialog.value = true;
|
|
openDialog.value = true;
|
|
};
|
|
};
|
|
|
|
+const changeDepartment = () => {
|
|
|
|
+ formData.data.orderList = [];
|
|
|
|
+};
|
|
|
|
+const openOrder = ref(false);
|
|
|
|
+const clickAddOrder = () => {
|
|
|
|
+ if (formData.data.departmentId) {
|
|
|
|
+ openOrder.value = true;
|
|
|
|
+ } else {
|
|
|
|
+ return ElMessage("请先选择事业部");
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+const selectOrder = (row) => {
|
|
|
|
+ if (formData.data.orderList && formData.data.orderList.length > 0) {
|
|
|
|
+ let list = formData.data.orderList.filter((item) => item.id === row.id);
|
|
|
|
+ if (list && list.length > 0) {
|
|
|
|
+ return ElMessage("该订单已添加");
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ formData.data.orderList = [];
|
|
|
|
+ }
|
|
|
|
+ formData.data.orderList.push({
|
|
|
|
+ id: row.id,
|
|
|
|
+ departmentName: row.departmentName,
|
|
|
|
+ code: row.code,
|
|
|
|
+ wlnCode: row.wlnCode,
|
|
|
|
+ totalAmount: row.totalAmount,
|
|
|
|
+ productTotalAmount: row.productTotalAmount,
|
|
|
|
+ customProcessingFee: row.customProcessingFee,
|
|
|
|
+ lssueFee: row.lssueFee,
|
|
|
|
+ deliveryMaterialsFee: row.deliveryMaterialsFee,
|
|
|
|
+ packingLabor: row.packingLabor,
|
|
|
|
+ packagingMaterialCost: row.packagingMaterialCost,
|
|
|
|
+ });
|
|
|
|
+ ElMessage({ message: "添加成功", type: "success" });
|
|
|
|
+};
|
|
|
|
+const clickOrderDelete = (index) => {
|
|
|
|
+ formData.data.orderList.splice(index, 1);
|
|
|
|
+};
|
|
const submitForm = () => {
|
|
const submitForm = () => {
|
|
- // submit.value.handleSubmit(() => {
|
|
|
|
- // proxy.post("/statementOfAccount/" + modalType.value, formData.data).then(() => {
|
|
|
|
- // ElMessage({
|
|
|
|
- // message: modalType.value == "add" ? "添加成功" : "编辑成功",
|
|
|
|
- // type: "success",
|
|
|
|
- // });
|
|
|
|
- // openDialog.value = false;
|
|
|
|
- // getList();
|
|
|
|
- // });
|
|
|
|
- // });
|
|
|
|
|
|
+ if (formData.data.orderList && formData.data.orderList.length > 0) {
|
|
|
|
+ let amount = 0;
|
|
|
|
+ for (let i = 0; i < formData.data.orderList.length; i++) {
|
|
|
|
+ amount = Number(Math.round((amount + formData.data.orderList[i].totalAmount) * 100) / 100);
|
|
|
|
+ }
|
|
|
|
+ let orderIdList = formData.data.orderList.map((item) => item.id);
|
|
|
|
+ proxy
|
|
|
|
+ .post("/statementOfAccount/" + modalType.value, {
|
|
|
|
+ departmentId: formData.data.departmentId,
|
|
|
|
+ amount: amount,
|
|
|
|
+ orderIdList: orderIdList,
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: modalType.value == "add" ? "添加成功" : "编辑成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ openDialog.value = false;
|
|
|
|
+ getList();
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ return ElMessage("请先添加订单");
|
|
|
|
+ }
|
|
};
|
|
};
|
|
const clickUpdate = (row) => {
|
|
const clickUpdate = (row) => {
|
|
modalType.value = "edit";
|
|
modalType.value = "edit";
|
|
@@ -344,25 +424,24 @@ const formReceiptData = reactive({
|
|
fileList: [],
|
|
fileList: [],
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
+const fileList = ref([]);
|
|
const clickReceiptFile = (row) => {
|
|
const clickReceiptFile = (row) => {
|
|
|
|
+ formReceiptData.data = {
|
|
|
|
+ id: row.id,
|
|
|
|
+ fileList: [],
|
|
|
|
+ };
|
|
if (row.receiptFileList && row.receiptFileList.length > 0) {
|
|
if (row.receiptFileList && row.receiptFileList.length > 0) {
|
|
- formReceiptData.data = {
|
|
|
|
- id: row.id,
|
|
|
|
- fileList: proxy.deepClone(
|
|
|
|
- row.receiptFileList.map((item) => {
|
|
|
|
- return {
|
|
|
|
- raw: item,
|
|
|
|
- name: item.fileName,
|
|
|
|
- url: item.fileUrl,
|
|
|
|
- };
|
|
|
|
- })
|
|
|
|
- ),
|
|
|
|
- };
|
|
|
|
|
|
+ fileList.value = proxy.deepClone(
|
|
|
|
+ row.receiptFileList.map((item) => {
|
|
|
|
+ return {
|
|
|
|
+ raw: item,
|
|
|
|
+ name: item.fileName,
|
|
|
|
+ url: item.fileUrl,
|
|
|
|
+ };
|
|
|
|
+ })
|
|
|
|
+ );
|
|
} else {
|
|
} else {
|
|
- formReceiptData.data = {
|
|
|
|
- id: row.id,
|
|
|
|
- fileList: [],
|
|
|
|
- };
|
|
|
|
|
|
+ fileList.value = [];
|
|
}
|
|
}
|
|
openReceiptFile.value = true;
|
|
openReceiptFile.value = true;
|
|
};
|
|
};
|
|
@@ -383,12 +462,21 @@ const onPreviewFile = (file) => {
|
|
window.open(file.raw.fileUrl, "_blank");
|
|
window.open(file.raw.fileUrl, "_blank");
|
|
};
|
|
};
|
|
const submitReceiptFile = () => {
|
|
const submitReceiptFile = () => {
|
|
- if (formReceiptData.data.fileList && formReceiptData.data.fileList.length > 0) {
|
|
|
|
- for (let i = 0; i < formReceiptData.data.fileList.length; i++) {
|
|
|
|
- if (formReceiptData.data.fileList[i].raw.uploadState) {
|
|
|
|
|
|
+ if (fileList.value && fileList.value.length > 0) {
|
|
|
|
+ for (let i = 0; i < fileList.value.length; i++) {
|
|
|
|
+ if (fileList.value[i].raw.uploadState) {
|
|
return ElMessage("文件上传中,请稍后提交");
|
|
return ElMessage("文件上传中,请稍后提交");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ formReceiptData.data.fileList = fileList.value.map((item) => {
|
|
|
|
+ return {
|
|
|
|
+ id: item.raw.id,
|
|
|
|
+ fileName: item.raw.fileName,
|
|
|
|
+ fileUrl: item.raw.fileUrl,
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ formReceiptData.data.fileList = [];
|
|
}
|
|
}
|
|
proxy.post("/statementOfAccount/editReceiptFile", formReceiptData.data).then(() => {
|
|
proxy.post("/statementOfAccount/editReceiptFile", formReceiptData.data).then(() => {
|
|
openReceiptFile.value = false;
|
|
openReceiptFile.value = false;
|
|
@@ -403,24 +491,22 @@ const formProofData = reactive({
|
|
},
|
|
},
|
|
});
|
|
});
|
|
const clickProofFile = (row) => {
|
|
const clickProofFile = (row) => {
|
|
|
|
+ formProofData.data = {
|
|
|
|
+ id: row.id,
|
|
|
|
+ fileList: [],
|
|
|
|
+ };
|
|
if (row.proofFileList && row.proofFileList.length > 0) {
|
|
if (row.proofFileList && row.proofFileList.length > 0) {
|
|
- formProofData.data = {
|
|
|
|
- id: row.id,
|
|
|
|
- fileList: proxy.deepClone(
|
|
|
|
- row.proofFileList.map((item) => {
|
|
|
|
- return {
|
|
|
|
- raw: item,
|
|
|
|
- name: item.fileName,
|
|
|
|
- url: item.fileUrl,
|
|
|
|
- };
|
|
|
|
- })
|
|
|
|
- ),
|
|
|
|
- };
|
|
|
|
|
|
+ fileList.value = proxy.deepClone(
|
|
|
|
+ row.proofFileList.map((item) => {
|
|
|
|
+ return {
|
|
|
|
+ raw: item,
|
|
|
|
+ name: item.fileName,
|
|
|
|
+ url: item.fileUrl,
|
|
|
|
+ };
|
|
|
|
+ })
|
|
|
|
+ );
|
|
} else {
|
|
} else {
|
|
- formProofData.data = {
|
|
|
|
- id: row.id,
|
|
|
|
- fileList: [],
|
|
|
|
- };
|
|
|
|
|
|
+ fileList.value = [];
|
|
}
|
|
}
|
|
openProofFile.value = true;
|
|
openProofFile.value = true;
|
|
};
|
|
};
|
|
@@ -438,18 +524,30 @@ const handleProofSuccess = (any, UploadFile) => {
|
|
UploadFile.raw.uploadState = false;
|
|
UploadFile.raw.uploadState = false;
|
|
};
|
|
};
|
|
const submitProofFile = () => {
|
|
const submitProofFile = () => {
|
|
- if (formProofData.data.fileList && formProofData.data.fileList.length > 0) {
|
|
|
|
- for (let i = 0; i < formProofData.data.fileList.length; i++) {
|
|
|
|
- if (formProofData.data.fileList[i].raw.uploadState) {
|
|
|
|
|
|
+ if (fileList.value && fileList.value.length > 0) {
|
|
|
|
+ for (let i = 0; i < fileList.value.length; i++) {
|
|
|
|
+ if (fileList.value[i].raw.uploadState) {
|
|
return ElMessage("文件上传中,请稍后提交");
|
|
return ElMessage("文件上传中,请稍后提交");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ formProofData.data.fileList = fileList.value.map((item) => {
|
|
|
|
+ return {
|
|
|
|
+ id: item.raw.id,
|
|
|
|
+ fileName: item.raw.fileName,
|
|
|
|
+ fileUrl: item.raw.fileUrl,
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ formProofData.data.fileList = [];
|
|
}
|
|
}
|
|
proxy.post("/statementOfAccount/editProofFile", formProofData.data).then(() => {
|
|
proxy.post("/statementOfAccount/editProofFile", formProofData.data).then(() => {
|
|
openProofFile.value = false;
|
|
openProofFile.value = false;
|
|
getList();
|
|
getList();
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
+const clickPrint = (row) => {
|
|
|
|
+ console.log(row);
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|