123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- <template>
- <div>
- <el-card class="box-card">
- <byTable
- :source="sourceList.data"
- :pagination="sourceList.pagination"
- :config="config"
- :loading="loading"
- :searchConfig="searchConfig"
- highlight-current-row
- @get-list="getList"
- @clickReset="clickReset"
- @changeRadioGroup="changeRadioGroup">
- </byTable>
- </el-card>
- <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="94%">
- <el-tabs v-model="activeName" class="demo-tabs">
- <el-tab-pane label="SKU对账单" name="sku">
- <PrintSKU :idGroupConcat="idGroupConcat" @clickCancel="openPrint = false"></PrintSKU>
- </el-tab-pane>
- <el-tab-pane label="BOM对账单" name="bom">
- <PrintBOM :idGroupConcat="idGroupConcat" @clickCancel="openPrint = false"></PrintBOM>
- </el-tab-pane>
- <el-tab-pane label="订单对账单" name="order">
- <PrintOrder :idGroupConcat="idGroupConcat" :activeName="activeName" @clickCancel="openPrint = false"></PrintOrder>
- </el-tab-pane>
- </el-tabs>
- </el-dialog>
- </div>
- </template>
- <script setup>
- import byTable from "/src/components/byTable/index";
- import PrintSKU from "/src/views/group/finance/summary/printSKU.vue";
- import PrintBOM from "/src/views/group/finance/summary/printBOM.vue";
- import PrintOrder from "/src/views/group/finance/summary/printOrder.vue";
- const { proxy } = getCurrentInstance();
- const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
- const sourceList = ref({
- data: [],
- pagination: {
- total: 0,
- pageNum: 1,
- pageSize: 10,
- type: 1,
- departmentId: "",
- beginTime: "",
- endTime: "",
- },
- });
- const loading = ref(false);
- const searchConfig = computed(() => {
- return [
- {
- type: "radio-group",
- prop: "type",
- label: "维度",
- data: [
- {
- dictKey: 1,
- dictValue: "月度",
- },
- {
- dictKey: 2,
- dictValue: "季度",
- },
- {
- dictKey: 3,
- dictValue: "年度",
- },
- ],
- },
- {
- type: "date",
- propList: ["beginTime", "endTime"],
- label: "日期",
- },
- {
- type: "select",
- prop: "departmentId",
- data: departmentList.value,
- label: "事业部",
- },
- ];
- });
- const config = computed(() => {
- return [
- {
- attrs: {
- label: "维度",
- prop: "dimensionality",
- },
- },
- {
- attrs: {
- label: "客户",
- prop: "departmentName",
- },
- },
- {
- attrs: {
- label: "对账金额",
- prop: "reconcilingAmount",
- align: "right",
- },
- render(val) {
- return proxy.moneyFormat(val);
- },
- },
- {
- attrs: {
- label: "对账单数量",
- prop: "quantityOfStatement",
- },
- },
- {
- attrs: {
- label: "合同数量",
- prop: "orderQuantity",
- },
- },
- {
- attrs: {
- label: "操作",
- width: 80,
- align: "center",
- fixed: "right",
- },
- renderHTML(row) {
- return [
- {
- attrs: {
- label: "打印",
- type: "primary",
- text: true,
- },
- el: "button",
- click() {
- clickPrint(row);
- },
- },
- ];
- },
- },
- ];
- });
- const getDemandData = () => {
- proxy.post("/department/page", { pageNum: 1, pageSize: 999 }).then((res) => {
- if (res.rows && res.rows.length > 0) {
- departmentList.value = departmentList.value;
- }
- });
- };
- getDemandData();
- const getList = async (req, status) => {
- if (status) {
- sourceList.value.pagination = {
- pageNum: sourceList.value.pagination.pageNum,
- pageSize: sourceList.value.pagination.pageSize,
- };
- } else {
- sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
- }
- if (sourceList.value.pagination.beginTime || sourceList.value.pagination.endTime) {
- sourceList.value.pagination.type = 4;
- }
- loading.value = true;
- proxy.post("/statementOfAccountMerge/page", sourceList.value.pagination).then((res) => {
- if (res.rows && res.rows.length > 0) {
- sourceList.value.data = res.rows.map((item) => {
- return {
- ...item,
- isCheck: true,
- };
- });
- } else {
- sourceList.value.data = [];
- }
- sourceList.value.pagination.total = res.total;
- setTimeout(() => {
- loading.value = false;
- }, 200);
- });
- };
- getList();
- const clickReset = () => {
- getList("", true);
- };
- const changeRadioGroup = () => {
- getList({ beginTime: "", endTime: "" });
- };
- const openPrint = ref(false);
- const idGroupConcat = ref("");
- const activeName = ref("sku");
- const clickPrint = (row) => {
- activeName.value = "sku";
- idGroupConcat.value = row.idGroupConcat;
- openPrint.value = true;
- };
- </script>
- <style lang="scss" scoped>
- :deep(.el-dialog) {
- margin-top: 10px !important;
- margin-bottom: 10px !important;
- }
- </style>
|