huangbin 4 роки тому
батько
коміт
70c374a9cf

+ 20 - 83
src/views/business/plan/components/detail/index.vue

@@ -1,7 +1,7 @@
 <template>
-  <!-- 计划详情-->
+  <!-- 套保计划详情-->
   <a-modal class="add-custom custom-detail"
-           title="计划详情"
+           title="套保计划详情"
            v-model:visible="visible"
            @cancel="cancel"
            width="890px">
@@ -16,89 +16,37 @@
             @submit="handleSearch">
       <a-row :gutter="24">
         <a-col :span="12">
-          <a-form-item label="客户类型">
-            <span class="white">{{ detail.userinfotype === '2' ? '企业' : '个人' }}</span>
+          <a-form-item label="计划类型">
+            <span class="white">{{ getPlanContractType(selectedRow.contracttype) }}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
-          <a-form-item label="企业名称">
-            <span class="white">{{ detail.customername }}</span>
+          <a-form-item label="计划名称">
+            <span class="white">{{ formatValue(selectedRow.hedgeplanno) }}</span>
           </a-form-item>
         </a-col>
       </a-row>
       <a-row :gutter="24">
         <a-col :span="12">
-          <a-form-item label="企业简称">
-            <span class="white">{{ detail.nickname }}</span>
+          <a-form-item label="现货品种">
+            <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
-          <a-form-item label="证件类型">
-            <span class="white">{{ detail.cardtypename }}</span>
+          <a-form-item label="标仓系数">
+            <span class="white">{{ formatValue(selectedRow.convertfactor) }}</span>
           </a-form-item>
         </a-col>
       </a-row>
       <a-row :gutter="24">
         <a-col :span="12">
-          <a-form-item label="法定代表人">
-            <span class="white">{{ detail.legalpersonname }}</span>
+          <a-form-item label="计划量">
+            <span class="white">{{ formatValue(selectedRow.planqty) }}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
-          <a-form-item label="证件号码">
-            <span class="white">{{ detail.cardnum }}</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="纳税人识别号">
-            <span class="white">{{ detail.taxpayernum }}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="营业执照">
-            <div class="upload">
-              <div class="look">查看附件</div>
-            </div>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="联系人">
-            <span class="white">{{ detail.contactname }}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="联系人手机号">
-            <span class="white">{{ detail.mobile }}</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="联系电话">
-            <span class="white">{{ detail.telphone }}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="状态">
-            <span class="green">{{ detail.status }}</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="24">
-          <a-form-item label="通讯地址">
-            <span class="white">{{ detail.address }}</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="24">
           <a-form-item label="备注">
-            <span class="white">{{ detail.remark }}</span>
+            <span class="white">{{ formatValue(selectedRow.remark) }}</span>
           </a-form-item>
         </a-col>
       </a-row>
@@ -112,33 +60,21 @@ import { closeModal } from '@/common/setup/modal/index';
 import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
 import { mergeObj } from '@/utils/objHandle';
 import { getStatusName } from '@/views/information/custom/setup';
+import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
+import { formatValue } from '@/common/methods';
+import { getPlanContractType } from '@/views/business/plan/setup';
 
 export default defineComponent({
     name: 'plan-detail',
     components: {},
     props: {
         selectedRow: {
-            type: Object as PropType<QueryCustomInfoType>,
+            type: Object as PropType<Ermcp3HedgePlan>,
             default: {},
         },
     },
-    setup(props) {
+    setup() {
         const { visible, cancel } = closeModal('detail');
-        const detail = reactive({
-            nickname: props.selectedRow.nickname || '--',
-            userinfotype: props.selectedRow.userinfotype || '--',
-            customername: props.selectedRow.customername || '--',
-            cardtypename: props.selectedRow.cardtypename || '--',
-            legalpersonname: props.selectedRow.legalpersonname || '--',
-            cardnum: props.selectedRow.cardnum || '--',
-            taxpayernum: props.selectedRow.taxpayernum || '--',
-            contactname: props.selectedRow.contactname || '--',
-            mobile: props.selectedRow.mobile || '--',
-            telphone: props.selectedRow.telphone || '--',
-            status: getStatusName(props.selectedRow.status) || '--',
-            address: props.selectedRow.address || '--',
-            remark: props.selectedRow.remark || '--',
-        });
         const loading = ref<boolean>(false);
         function submit() {
             loading.value = true;
@@ -152,7 +88,8 @@ export default defineComponent({
             cancel,
             submit,
             loading,
-            detail,
+            formatValue,
+            getPlanContractType,
         };
     },
 });

+ 16 - 0
src/views/business/plan/setup.ts

@@ -0,0 +1,16 @@
+/**
+ * 计划类型 - 1:采购 -1:销售
+ * @param contracttype 返回计划类型
+ */
+export function getPlanContractType(contracttype: number): string{
+    let result = "--";
+    switch (contracttype) {
+        case 1:
+            result = "套保采购计划";
+            break
+        case 2:
+            result = "套保销售计划";
+            break
+    }
+    return result
+}

+ 113 - 17
src/views/business/purchase/components/detail/index.vue

@@ -1,30 +1,123 @@
 <template>
-  <!-- 采购详情-->
-  <a-modal class="custom-detail"
-           title="详情"
-           v-model:visible="visible"
-           @cancel="cancel"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">关闭</a-button>
-    </template>
-
-  </a-modal>
+    <!-- 采购合同详情-->
+    <a-modal class="custom-detail"
+             title="详情"
+             v-model:visible="visible"
+             @cancel="cancel"
+             width="890px">
+        <template #footer>
+            <a-button key="submit"
+                      type="primary"
+                      :loading="loading"
+                      @click="submit">关闭
+            </a-button>
+        </template>
+        <fieldset class="formFieldSet">
+            <legend>合同基本信息</legend>
+            <a-form class="inlineForm"
+                    :form="form"
+                    @submit="handleSearch">
+                <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.enumdicname) }}</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"
+                    :form="form"
+                    @submit="handleSearch">
+                <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) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </a-form>
+        </fieldset>
+        <fieldset class="formFieldSet">
+            <legend>本次点价信息</legend>
+            <a-form class="inlineForm"
+                    :form="form"
+                    @submit="handleSearch">
+                <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-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
+import {defineComponent, PropType, ref} from 'vue';
+import {closeModal} from '@/common/setup/modal/index';
+import {formatValue} from "@/common/methods";
+import {Ermcp3SellBuyContract} from "@/services/go/ermcp/purchase/interface";
+import {getPriceTypeName} from "@/views/business/purchase/setup";
 
 export default defineComponent({
     name: 'purchase_pending-detail',
     components: {},
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3SellBuyContract>,
+            default: {},
+        },
+    },
     setup() {
-        const { visible, cancel } = closeModal('detail');
+        const {visible, cancel} = closeModal('detail');
         const loading = ref<boolean>(false);
+
         function submit() {
             loading.value = true;
             setTimeout(() => {
@@ -32,11 +125,14 @@ export default defineComponent({
                 cancel();
             }, 2000);
         }
+
         return {
             visible,
             cancel,
             submit,
             loading,
+            formatValue,
+            getPriceTypeName,
         };
     },
 });

+ 1 - 1
src/views/business/purchase/list/pending/index.vue

@@ -26,7 +26,7 @@
       </a-table>
     </contextMenu>
     <!-- 详情 -->
-    <Detail />
+    <Detail :selectedRow="selectedRow" />
     <!-- 采购点价登记 -->
     <SomePrice />
   </div>

+ 17 - 77
src/views/business/purchase/setup.ts

@@ -1,79 +1,19 @@
-import { QueryPurchase } from '@/services/go/ermcp/purchase';
-import { Ermcp3SellBuyContract, SellBuyContractReq } from '@/services/go/ermcp/purchase/interface';
-import APP from '@/services';
-import { getUserId } from '@/services/bus/account';
-import { initData } from '@/common/methods';
-import { ColumnType, getTableHead } from '@/common/methods/table';
-import { detailButton, permissionButton, handlePermission } from '@/common/setup/buttonPermission/index';
-import { MenuItem } from '@/common/components/contextMenu/interface';
-import { openModal } from '@/common/setup/modal/index';
-import { watchEffect, ref } from 'vue';
-// 采购数据获取和表头数据整理
-export function handlePurchase() {
-    // ========================loading========================
-    const loading = ref<boolean>(false);
-    // ========================获取列表数据========================
-    let customList = ref<Ermcp3SellBuyContract[] | []>([]);
-    function queryPurchase() {
-        const AreaUserID = APP.get('userAccount').memberuserid; // 所属机构id
-        const req: SellBuyContractReq = {
-            areauserid: AreaUserID, //  所属机构ID
-            contracttype: 1, // 合同类型 1-采购, -1-销售
-            querytype: 1, // 查询类型 1-全部 2-待点价 3-履约结算 4-已完成
-            userid: getUserId(), // 用户ID
-        };
-        QueryPurchase(req).then((res) => {
-            customList.value = res;
-        });
+/**
+ * 定价类型 - 1:一口价 2:点价 3:暂定价
+ * @param pricetype 定价类型
+ */
+export function getPriceTypeName(pricetype: number): string{
+    let result : string = "--";
+    switch (pricetype){
+        case 1:
+            result = "一口价";
+            break
+        case 2:
+            result = "点价";
+            break
+        case 3:
+            result = "暂定价";
+            break
     }
-
-    // ========================获取表头========================
-    const columns = ref<ColumnType[]>([]);
-    function getColumns() {
-        const list = getTableHead('table_pcweb_purchase');
-        columns.value.length = 0;
-        list.forEach((e, i) => {
-            const { columnfield, columntitle, aligntype } = e;
-            const item: ColumnType = {
-                key: String(i),
-                dataIndex: columnfield,
-                title: columntitle,
-                align: aligntype === 1 ? 'center' : aligntype === 2 ? 'left' : 'right',
-                slots: { customRender: columnfield },
-            };
-            columns.value.push(item);
-        });
-    }
-
-    // ========================数据初始化========================
-    initData((): void => {
-        queryPurchase();
-        getColumns();
-    });
-    return { loading, customList, columns };
-}
-
-// 按钮权限与功能组件
-export function btnAndComp() {
-    // 传入父及的code 得到当前1234级的整个权限
-    const { hasPermission } = handlePermission('purchase_pending');
-    // 配置右键菜单列表
-    const contextMenuList = ref<MenuItem[]>([]);
-    // 打开新增页的弹窗 返回打开弹窗的方法
-    const { openAction: addAction } = openModal('addCustomInfo');
-    // 创建详情页并写入右键菜单列表(每个页面都有,写死)
-    detailButton('customDetail', contextMenuList);
-    // 通过code跟弹窗建立联系 返回写入右键的方法
-    const { action: deleteAction } = permissionButton('purchase_pending_someprice', '点价登记', contextMenuList);
-
-    const stop = watchEffect(() => {
-        // 判断是否有权限 有就写入
-        hasPermission('custom_info_btn_delete') && deleteAction();
-    });
-    return {
-        stop,
-        addAction,
-        hasPermission,
-        contextMenuList,
-    };
+    return result
 }