123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 |
- <template>
- <div class="pageIndexClass">
- <div class="content">
- <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :selectConfig="selectConfig"
- highlight-current-row :action-list="[]" @get-list="getList">
- <template #amount="{ item }">
- <div>
- <span style="padding-right: 4px">{{ item.currency }}</span>
- <span>{{ moneyFormat(item.amount, 2) }}</span>
- </div>
- </template>
- <template #refundMoney="{ item }">
- <div>
- <span style="padding-right: 4px">{{ item.currency }}</span>
- <span>{{ moneyFormat(item.sumContractClaimMoney, 2) }}</span>
- </div>
- </template>
- <template #sumContractNotClaimMoney="{ item }">
- <div>
- <span style="padding-right: 4px">{{ item.currency }}</span>
- <span>{{ moneyFormat(item.sumContractNotClaimMoney, 2) }}</span>
- </div>
- </template>
- <template #advanceRatio="{ item }">
- <div>
- <span>{{ item.advanceRatio }}%</span>
- </div>
- </template>
- </byTable>
- </div>
- </div>
- </template>
- <script setup>
- import { computed, ref } from "vue";
- import byTable from "@/components/byTable/index";
- import useUserStore from "@/store/modules/user";
- import { ElMessage, ElMessageBox } from "element-plus";
- const { proxy } = getCurrentInstance();
- const contractType = ref([]);
- const corporationList = ref([]);
- const status = ref([
- {
- label: "草稿",
- value: 0,
- },
- {
- label: "审批中",
- value: 10,
- },
- {
- label: "驳回",
- value: 20,
- },
- {
- label: "审批通过",
- value: 30,
- },
- {
- label: "终止",
- value: 99,
- },
- ]);
- const refundStatus = ref([
- {
- label: "未到款",
- value: 0,
- },
- {
- label: "部分到款",
- value: 10,
- },
- ]);
- const sourceList = ref({
- data: [],
- pagination: {
- total: 0,
- pageNum: 1,
- pageSize: 10,
- keyword: "",
- sellCorporationId: "",
- },
- });
- const loading = ref(false);
- const selectConfig = computed(() => {
- return [
- {
- label: "到款状态",
- prop: "refundStatusNew",
- data: refundStatus.value,
- },
- ];
- });
- const config = computed(() => {
- return [
- {
- attrs: {
- label: "业务公司",
- prop: "sellCorporationId",
- "min-width": 220,
- },
- render(type) {
- let text = "";
- if (corporationList.value && corporationList.value.length > 0) {
- let data = corporationList.value.filter((item) => item.value == type);
- if (data && data.length > 0) {
- text = data[0].label;
- }
- }
- return text;
- },
- },
- {
- attrs: {
- label: "订单类型",
- prop: "contractType",
- width: 120,
- },
- render(type) {
- let text = "";
- if (contractType.value && contractType.value.length > 0) {
- let data = contractType.value.filter((item) => item.value == type);
- if (data && data.length > 0) {
- text = data[0].label;
- }
- }
- return text;
- },
- },
- {
- attrs: {
- label: "合同编码",
- prop: "code",
- width: 180,
- },
- },
- {
- attrs: {
- label: "客户",
- prop: "buyCorporationName",
- "min-width": 220,
- },
- },
- // {
- // attrs: {
- // label: "版本号",
- // prop: "version",
- // width: 120,
- // },
- // },
- {
- attrs: {
- label: "合同金额",
- slot: "amount",
- width: 140,
- },
- },
- // {
- // attrs: {
- // label: "已到账金额",
- // slot: "refundMoney",
- // width: 140,
- // },
- // },
- {
- attrs: {
- label: "未结清金额",
- slot: "sumContractNotClaimMoney",
- width: 140,
- },
- },
- {
- attrs: {
- label: "业务员",
- prop: "userName",
- width: 140,
- },
- },
- {
- attrs: {
- label: "创建时间",
- prop: "createTime",
- width: 160,
- },
- },
- {
- attrs: {
- label: "到款状态",
- prop: "refundStatusNew",
- width: 80,
- },
- render(refundStatusNew) {
- return proxy.dictValueLabel(refundStatusNew, refundStatus.value);
- },
- },
- {
- attrs: {
- label: "审批状态",
- prop: "status",
- width: 140,
- },
- render(type) {
- let text = "";
- if (status.value && status.value.length > 0) {
- let data = status.value.filter((item) => item.value == type);
- if (data && data.length > 0) {
- text = data[0].label;
- }
- }
- return text;
- },
- },
- {
- attrs: {
- label: "操作",
- width: "120",
- align: "center",
- fixed: "right",
- },
- renderHTML(row) {
- return [
- {
- attrs: {
- label: "选择",
- type: "primary",
- text: true,
- },
- el: "button",
- click() {
- handleSelect(row);
- },
- },
- ];
- },
- },
- ];
- });
- const getDict = () => {
- proxy
- .post("/dictTenantData/page", {
- pageNum: 1,
- pageSize: 999,
- dictCode: "contract_type",
- tenantId: useUserStore().user.tenantId,
- })
- .then((res) => {
- if (res.rows && res.rows.length > 0) {
- contractType.value = res.rows.map((item) => {
- return {
- label: item.dictValue,
- value: item.dictKey,
- };
- });
- }
- });
- proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
- corporationList.value = res.rows.map((item) => {
- return {
- ...item,
- label: item.name,
- value: item.id,
- };
- });
- });
- };
- const getList = async (req) => {
- sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
- loading.value = true;
- proxy
- .post("/contract/contractAndSamplePage", sourceList.value.pagination)
- .then((res) => {
- sourceList.value.data = res.rows;
- sourceList.value.pagination.total = res.total;
- setTimeout(() => {
- loading.value = false;
- }, 200);
- });
- };
- getDict();
- getList();
- const handleSelect = (row) => {
- proxy.$emit("handleSelectContrct", row);
- };
- </script>
- <style lang="scss" scoped>
- .tenant {
- padding: 20px;
- }
- ::v-deep(.el-input-number .el-input__inner) {
- text-align: left;
- }
- </style>
|