chen.zujie vor 4 Jahren
Ursprung
Commit
38117065ae

+ 133 - 0
src/views/business/purchase/components/common-detail/index.vue

@@ -0,0 +1,133 @@
+<template>
+  <a-form class="inlineForm">
+    <fieldset class="formFieldSet">
+      <legend>基本信息</legend>
+      <Des :list="baseInfo"
+           @onClick="baseInfoClick" />
+    </fieldset>
+    <fieldset class="formFieldSet">
+      <legend>现货信息</legend>
+      <Des :list="spotInfo" />
+    </fieldset>
+    <fieldset class="formFieldSet">
+      <legend>现货信息</legend>
+      <Des :list="priceInfo" />
+    </fieldset>
+    <slot></slot>
+    <a-modal :visible="previewVisible"
+             :footer="null"
+             @cancel="cancelImg">
+      <img alt="预览附件"
+           style="width: 100%"
+           :src="previewImage" />
+    </a-modal>
+  </a-form>
+
+</template>
+
+<script lang="ts">
+import { defineComponent, PropType, watchEffect } from 'vue';
+import { getBizTypeName, getContractStatusName, getContractTypeName, getPriceTypeName } from '@/common/constants/enumsName';
+import { formatTime, formatValue } from '@/common/methods';
+import { Des, DescriptionsList, handleDesList } from '@/common/components/commonDes';
+import { handlePreviewImg } from '@/common/setup/upload';
+import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
+import { queryTableList} from '@/common/export/commonTable';
+import { QuerySpotContract } from '@/services/go/ermcp/spot-contract';
+
+
+export default defineComponent({
+    name: 'custom-detail-desc',
+    components: { Des },
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3ContractRsp>,
+            default: {},
+        },
+    },
+    setup(props) {
+        // 基本信息
+        const { desList: baseInfo, getDesList: getBaseInfo } = handleDesList();
+        // 现货信息
+        const { desList: spotInfo, getDesList: getSpotInfo } = handleDesList();
+        // 价格信息
+        const { desList: priceInfo, getDesList: getPriceInfo } = handleDesList();
+        // 预览附件
+        const { previewVisible, previewImage, cancelImg, previewImg, getImgName } = handlePreviewImg();
+
+        const { queryTable } = queryTableList<Ermcp3ContractRsp>();
+        //
+        function baseInfoClick({ label }: DescriptionsList) {
+            const { attachment } = props.selectedRow;
+            switch (label) {
+                case '合同附件':
+                    previewImg(attachment);
+                    break;
+            }
+        }
+
+        
+
+        watchEffect(async () => {
+            if (props.selectedRow.contractno) {
+                console.log('props.selectedRow', props.selectedRow);
+
+            let data:any=await queryTable(QuerySpotContract, { contractno: props.selectedRow.contractno })
+            data=data[0]
+                // 基本信息
+                const base = [
+                    { label: '合同编号', value: formatValue(data.contractno) },
+                    { label: '合同类型', value: getContractTypeName(data.contracttype) },
+                    { label: '业务类型', value: getBizTypeName(data.biztype) },
+                    { label: '采购方', value: formatValue(data.buyusername) },
+                    { label: '销售方', value: formatValue(data.sellusername) },
+                    { label: '合同附件', value: formatValue(getImgName(data.attachment)) },
+                    { label: '状态', value: getContractStatusName(data.contracctstatus), className: 'green' },
+                    { label: "交易主体",value:formatValue(data.subjectname)}
+                ];
+                getBaseInfo(base);
+                // 现货信息
+                const spot = [
+                    { label: '现货品种', value: formatValue(data.deliverygoodsname) },
+                    { label: '商品', value: formatValue(data.wrstandardname) },
+                    { label: '品牌', value: formatValue(data.brandname) },
+                    { label: '商品规格', value: formatValue(data.spotgoodsdesc) },
+                ];
+                getSpotInfo(spot);
+                // 价格信息
+                const price = [
+                    { label: '定价类型', value: getPriceTypeName(data.pricetype) },
+                    { label: '数量', value: formatValue(data.qty) + data.enumdicname },
+                    { label: data.pricetype === 2 ? '点价合约' : '价格', value: data.pricetype === 2 ? formatValue(data.goodscode) : formatValue(data.price) },
+                    { label: '升贴水', value: formatValue(data.pricemove) },
+                    { label: '点价期', value: formatValue(formatTime(data.startdate, 'd') + '--' + formatTime(data.enddate, 'd')) },
+                    { label: '交收期', value: formatValue(formatTime(data.deliverystartdate, 'd') + '--' + formatTime(data.deliveryenddate, 'd')) },
+                ];
+                getPriceInfo(price);
+            }
+        });
+        return {
+            baseInfo,
+            spotInfo,
+            priceInfo,
+            previewVisible,
+            previewImage,
+            cancelImg,
+            baseInfoClick,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.custom-detail {
+    .ant-form.inlineForm {
+        margin-top: 20px;
+    }
+    .upload {
+        .look {
+            margin-left: 0;
+        }
+    }
+}
+</style>;

+ 224 - 80
src/views/business/purchase/components/detail/index.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 采购合同详情-->
-  <a-modal class="commonModal paddingDialog purchase-detail"
+  <a-modal class="add-custom custom-detail"
            title="详情"
            v-model:visible="visible"
            centered
@@ -13,84 +13,69 @@
                 @click="submit">关闭
       </a-button>
     </template>
-    <fieldset class="formFieldSet">
-      <legend>合同基本信息</legend>
-      <a-form class="inlineForm">
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="合同编号">
-              <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="合同类型">
-              <span class="white">{{ getPriceTypeName(selectedRow.pricetype) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="销售方">
-              <span class="white">{{ formatValue(selectedRow.accountname) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="现货品种">
-              <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="合同签署量">
-              <span
-                    class="white">{{ formatValue(selectedRow.qty + selectedRow.enumdicname) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="合同暂定价">
-              <span class="white">{{ formatValue(selectedRow.price) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="点价合约">
-              <span class="white">{{ formatValue(selectedRow.goodsname) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </a-form>
-    </fieldset>
-    <fieldset class="formFieldSet">
-      <legend>已登记信息</legend>
-      <a-form class="inlineForm">
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="已定价量">
-              <span class="white">{{ selectedRow.pricedqty + selectedRow.enumdicname }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="已点均价">
-              <span class="white">{{ formatValue(selectedRow.pricedavg.toFixed(2)) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </a-form>
-    </fieldset>
-    <fieldset class="formFieldSet">
-      <legend>本次点价信息</legend>
-      <a-form class="inlineForm">
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="升贴水">
-              <span class="white">{{ formatValue(selectedRow.pricemove) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </a-form>
-    </fieldset>
+    <a-tabs v-model:activeKey="activeKey" @change="tabClick">
+        <a-tab-pane v-for="item in tabList" :key="item.key" :tab="item.name"></a-tab-pane>
+    </a-tabs>
+    <InfoDetail :selectedRow="selectedRow" v-if="activeKey == 1" />
+    <div class="tableDatas" v-else>
+            <a-table class="dialogTable" :columns="columns" :data-source="tableList" :pagination="false">
+                <template #status="{ text }">
+                    <span class="yellow">{{ text }}</span>
+                    <!-- 审核通过'green' 审核拒绝 'orange' 待审核'yellow'   -->
+                </template>
+
+                <template #applystatus="{ text }">
+                    <a>{{ getApplyStatusName(text) }}</a>
+                </template>
+
+                <!-- 发票金额-->
+                <template #invoicetype="{ text }">
+                    <a>{{ invoiceStatusName(text) }}</a>
+                </template>
+
+                <!-- 发票类型-->
+                <template #contracttype="{ text }">
+                    <a>{{ getReceiptName(text) }}</a>
+                </template>
+
+                <!-- 出入库类型 -->
+                <template #inouttype="{ text }">
+                    <a>{{ InOutTypeName(text) }}</a>
+                </template>
+
+                <!-- 款项类型 -->
+                <template #kxtype="{ record }">
+                    <a>{{ stateName(record.deductamount, record.contracttype) }}</a>
+                </template>
+
+                <!-- 金额-->
+                <template #payamount="{ text, record }">
+                    <span>{{ formatValue(record.kxtype === 2 ? record.deductamount : text) }}</span>
+                </template>
+
+                <!-- 调整付保证金-->
+                <template #addmargin="{ record }">
+                    <span>{{ formatValue(record.addmargin === undefined || '' ? record.decmargin : record.addmargin) }}</span>
+                </template>
+
+                <!-- 交收量 -->
+                <template #reckonrealqty="{ record }">
+                    <span>{{ formatValue(record.reckonrealqty) }}</span>
+                </template>
+
+                <!-- 其他费用 -->
+                <template #reckonotheramount="{ record }">
+                    <span>{{ formatValue(record.reckonotheramount) }}</span>
+                </template>
+
+                <!-- 申请人 -->
+                <template #applyname="{ record }">
+                    <span>{{ formatValue(record.applyname) }}</span>
+                </template>
+
+                <!-- 款项记录 款项类型为退款  则金额使用deductamount-->
+            </a-table>
+        </div>
   </a-modal>
 </template>
 
@@ -100,10 +85,22 @@ import { formatValue } from '@/common/methods';
 import { Ermcp3SellBuyContract } from '@/services/go/ermcp/purchase/interface';
 import { getPriceTypeName } from '@/common/constants/enumsName';
 import { _closeModal } from '@/common/setup/modal/modal';
+import { getTableColumns } from '@/common/setup/table';
+import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { QueryBusinessFp, QueryBusinessKx } from '@/services/go/ermcp/finance-review';
+import { QueryBusinessDj, QueryBusinessJs } from '@/services/go/ermcp/business-review';
+import { QueryAreaStockApply } from '@/services/go/ermcp/inventory-review';
+import { QueryChangeLog } from '@/services/go/ermcp/spot-contract';
+import { QueryPaTradeLinkDetail } from '@/services/go/ermcp/patrade-link';
+import { columnsPaTradeLink } from '@/views/information/spot-contract/components/detail/setup';
+import InfoDetail from '../infoDetail/index.vue'
+import { getApplyStatusName, getReceiptName } from '@/common/constants/enumsName';
+import { InOutTypeName } from '@/views/manage/inventory-review/setup';
+import { invoiceStatusName, stateName } from '@/views/manage/finance-review/setup';
 
 export default defineComponent({
     name: 'purchase_pending-detail',
-    components: {},
+    components: {InfoDetail},
     emits: ['cancel', 'update'],
     props: {
         selectedRow: {
@@ -115,10 +112,99 @@ export default defineComponent({
         const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
 
+        const tabList = ref<{ key: number; name: string }[]>([]);
+
+        const activeKey = ref<number>(1);
+
+        const tableList = ref<any[]>([]);
+        // 表头数据
+        const { columns, registerColumn } = getTableColumns();
+
+
         function submit() {
             cancel();
         }
 
+
+
+        // 审核拒绝和未提交不显示后面的选项
+        tabList.value = [0, 4, 6].includes(props.selectedRow.contracctstatus)
+            ? [{ key: 1, name: '合同详情' }]
+            : [
+                  { key: 1, name: '合同详情' },
+                  { key: 2, name: '点价记录' },
+                  { key: 3, name: '交收记录' },
+                  { key: 4, name: '款项记录' },
+                  { key: 5, name: '发票记录' },
+                  { key: 6, name: props.selectedRow.contracttype === 1 ? '入库记录' : '出库记录' },
+                  { key: 8, name: '变更记录' },
+                  { key: 9, name: '关联记录' },
+              ];
+        activeKey.value = 1;
+        function tabClick() {
+            const relatedid = props.selectedRow.spotcontractid;
+            switch (activeKey.value) {
+                case 1:
+                    break;
+                case 2: // 点价记录
+                    registerColumn('table_pcweb_someprice_detail_dj', []);
+                    queryResultLoadingAndInfo(QueryBusinessDj, loading, { relatedid }).then((res) => {
+                      console.log(res,'hhh')
+                        tableList.value = res;
+                    });
+                    break;
+                case 3: // 交收记录
+                    registerColumn('table_pcweb_someprice_detail_js', []);
+                    queryResultLoadingAndInfo(QueryBusinessJs, loading, { relatedid }).then((res) => {
+                        tableList.value = res;
+                    });
+                    break;
+                case 4: //款项记录
+                    registerColumn('table_pcweb_someprice_detail_kx', []);
+                    queryResultLoadingAndInfo(QueryBusinessKx, loading, { relatedid }).then((res) => {
+                        tableList.value = res;
+                    });
+                    break;
+                case 5: // 发票记录
+                    registerColumn('table_pcweb_someprice_detail_fp', []);
+                    queryResultLoadingAndInfo(QueryBusinessFp, loading, { relatedid }).then((res) => {
+                        tableList.value = res;
+                    });
+                    break;
+                case 6: // 入库记录
+                    registerColumn('table_pcweb_someprice_detail_stock', []);
+                    queryResultLoadingAndInfo(QueryAreaStockApply, loading, {
+                        spotcontractid: relatedid,
+                        inouttype: '1,3',
+                    }).then((res) => {
+                        tableList.value = res;
+                    });
+                    break;
+                case 7: // 出库记录
+                    registerColumn('table_pcweb_someprice_detail_stock_out', []);
+                    queryResultLoadingAndInfo(QueryAreaStockApply, loading, {
+                        spotcontractid: relatedid,
+                        inouttype: '2,4',
+                    }).then((res) => {
+                        tableList.value = res;
+                    });
+                    break;
+                case 8: //// 变更记录
+                    registerColumn('table_pcweb_someprice_detail_change', []);
+                    queryResultLoadingAndInfo(QueryChangeLog, loading, { RelatedId: relatedid }).then((res) => {
+                        tableList.value = res;
+                    });
+                    break;
+                case 9: //// 关联记录
+                    columns.value.length = 0;
+                    columns.value.push(...columnsPaTradeLink);
+                    queryResultLoadingAndInfo(QueryPaTradeLinkDetail, loading).then((res) => {
+                        tableList.value = res;
+                    });
+                    break;
+            }
+        }
+
         return {
             visible,
             cancel,
@@ -126,10 +212,68 @@ export default defineComponent({
             loading,
             formatValue,
             getPriceTypeName,
+            tabClick,
+            tabList,
+            tableList,
+            activeKey,
+            columns,
+            getApplyStatusName, 
+            getReceiptName,
+            InOutTypeName,
+            invoiceStatusName, 
+            stateName,
         };
     },
 });
 </script>
 
 <style lang="less">
+.custom-detail {
+    .ant-modal-content {
+        .ant-modal-body {
+            padding-top: 0;
+            padding-left: 0;
+            padding-right: 0;
+
+            .ant-tabs {
+                background: @m-black11;
+                width: 100%;
+                padding: 0 24px;
+
+                .ant-tabs-bar {
+                    margin-bottom: 0;
+                    border-bottom: 0;
+                }
+                .anticon {
+                    color: @m-grey2;
+                }
+                .ant-tabs-nav-container {
+                    .ant-tabs-nav-wrap {
+                        .ant-tabs-nav {
+                            .ant-tabs-tab {
+                                width: 70px;
+                                margin-right: 43px;
+                                text-align: center;
+                                font-size: 16px;
+                                color: @m-grey2;
+                                padding: 0;
+                                line-height: 45px;
+                            }
+
+                            .ant-tabs-tab-active.ant-tabs-tab {
+                                color: @m-blue0;
+                            }
+
+                            .ant-tabs-ink-bar {
+                                width: 70px !important;
+                                background: @m-blue0;
+                                .rounded-corners(1px);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
 </style>;

+ 55 - 0
src/views/business/purchase/components/infoDetail/index.vue

@@ -0,0 +1,55 @@
+<template>
+  <Detail :selectedRow="selectedRow">
+    <fieldset class="formFieldSet">
+      <legend>其它信息</legend>
+      <Des :list="desList" />
+    </fieldset>
+  </Detail>
+</template>
+
+<script lang="ts">
+import { defineComponent, PropType } from 'vue';
+import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
+import { formatValue } from '@/common/methods';
+import Detail from '../common-detail/index.vue';
+import { Des, handleDesList } from '@/common/components/commonDes';
+import { businessManager, findManagerName } from '@/views/information/spot-contract/list/setup';
+
+export default defineComponent({
+    name: 'spot-contract-info-detail',
+    components: { Detail, Des },
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3ContractRsp>,
+            default: {},
+        },
+    },
+    setup(props, context) {
+        // 预览附件
+        console.log(props.selectedRow,111)
+        const { desList, getDesList } = handleDesList();
+        const data = props.selectedRow;
+        const list = [
+            { label: '保证金', value: formatValue(data.contractmargin) },
+            { label: '业务员', value: formatValue(findManagerName(data.saleuserid, businessManager.value)) },
+            { label: '跟单员', value: formatValue(findManagerName(data.meruserid, businessManager.value)) },
+            { label: '交易用户', value: formatValue(data.tradeusername) },
+            { label: '备注', value: formatValue(data.remark) },
+        ];
+        getDesList(list);
+        return {
+            desList,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.custom-detail {
+    .upload {
+        .look {
+            margin-left: 0;
+        }
+    }
+}
+</style>;