huangbin vor 4 Jahren
Ursprung
Commit
71f6151c64

+ 37 - 114
src/views/order/performance_information/components/components/detail/index.vue

@@ -1,61 +1,50 @@
 <template>
-    <!-- 履约明细-->
-    <Drawer
-        :title="'履约明细'"
-        :placement="'right'"
-        class="bottomWidth"
-        :visible="visible"
-        @cancel="cancel"
-    >
-        <div class="listed">
-            <div class="condition">
-                <a-button class="conditionBtn">{{selectedRow.deliverygoodsname}}</a-button>
-                <a-button class="conditionBtn">{{selectedRow.wrtypename}}</a-button>
-                <a-button class="conditionBtn">{{selectedRow.warehousename}}</a-button>
-            </div>
-            <a-table
-                class="dialogTable"
-                :columns="columns"
-                :data-source="performancePlanStepList"
-                :pagination="false"
-            >
-                <template #isauto="{ text }">
-                    <span>{{text ? '是' : '否'}}</span>
-                </template>
-                <template #handlestatus="{ text }">
-                    <span>{{getStatus(text)}}</span>
-                </template>
-            </a-table>
-        </div>
-    </Drawer>
+  <!-- 履约明细-->
+  <Drawer :title="'履约明细'"
+          :placement="'right'"
+          class="bottomWidth"
+          :visible="visible"
+          @cancel="cancel">
+    <div class="listed">
+      <div class="condition">
+        <a-button class="conditionBtn">{{selectedRow.deliverygoodsname}}</a-button>
+        <a-button class="conditionBtn">{{selectedRow.wrtypename}}</a-button>
+        <a-button class="conditionBtn">{{selectedRow.warehousename}}</a-button>
+      </div>
+      <a-table class="dialogTable"
+               :columns="columns"
+               :data-source="performancePlanStepList"
+               :pagination="false">
+        <template #isauto="{ text }">
+          <span>{{text ? '是' : '否'}}</span>
+        </template>
+        <template #stepvalue="{ text }">
+          <span>{{(text* 100).toFixed(0)}}</span>
+        </template>
+        <template #handlestatus="{ text }">
+          <span>{{getPerformanceStatusName(text)}}</span>
+        </template>
+      </a-table>
+    </div>
+  </Drawer>
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref } from 'vue';
-import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
+import { defineComponent, PropType } from 'vue';
 import Drawer from '@/common/components/drawer/index.vue';
-import { QueryWrPositionReq, WrHoldLB, WrPerformancePlan, WrPosition } from '@/services/go/wrtrade/interface';
-import { getInTaAccount, getUserId } from '@/services/bus/account';
-import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { hdWROrder } from '@/services/proto/warehousetrade';
-import { v4 as uuidv4 } from 'uuid';
-import moment from 'moment';
+import { WrPerformancePlan } from '@/services/go/wrtrade/interface';
 import { ModalEnum } from '@/common/constants/modalNameEnum';
 import { _closeModal } from '@/common/setup/modal/modal';
-import { validateAction } from '@/common/setup/form';
-import { getMarketRunByTradeMode } from '@/services/bus/market';
-import { message } from 'ant-design-vue';
-import { getGoodsGroupsByTradeMode } from '@/services/bus/goods';
-import { BuyOrSell, TradeMode } from '@/common/constants/enumCommon';
-import { WRGoodsInfo } from '@/services/proto/warehousetrade/interface';
-import { CaretRightOutlined } from '@ant-design/icons-vue';
+
+import { BuyOrSell } from '@/common/constants/enumCommon';
 import { handlePerformancePlanStep } from '../setup';
+import { getPerformanceStatusName } from '@/common/constants/enumsName';
 
 const columns = [
     { title: '履约步骤', dataIndex: 'steptypename', key: 'steptypename', align: 'center' },
     // { title: '天数', dataIndex: 'applytime', key: 'applytime', align: 'center' },
     { title: '剩余天数', dataIndex: 'remaindays', key: 'remaindays', align: 'center' },
-    { title: '步骤值(%)', dataIndex: 'stepvalue', key: 'stepvalue', align: 'center' },
+    { title: '步骤值(%)', dataIndex: 'stepvalue', key: 'stepvalue', align: 'center', slots: { customRender: 'stepvalue' } },
     { title: '距离上一步', dataIndex: 'stepdays', key: 'stepdays', align: 'center' },
     { title: '自动', dataIndex: 'isauto', key: 'isauto', align: 'center', slots: { customRender: 'isauto' } },
     { title: '当前状态', dataIndex: 'handlestatus', key: 'handlestatus', align: 'center', slots: { customRender: 'handlestatus' } },
@@ -63,7 +52,7 @@ const columns = [
 
 export default defineComponent({
     name: ModalEnum.performance_information_buy_performance_detail,
-    components: { Drawer, CaretRightOutlined },
+    components: { Drawer },
     emits: ['cancel', 'update'],
     props: {
         selectedRow: {
@@ -77,79 +66,13 @@ export default defineComponent({
     },
     setup(props, context) {
         const { visible, cancel } = _closeModal(context);
-        const { performancePlanStepList } = handlePerformancePlanStep(props.selectedRow);
-        function getStatus(type: number) {
-            //处理状态 - 1:开始 2:结束 3:冻结请求 4:冻结返回成功 5:冻结返回失败 6:扣款请求 7:扣款返回成功 8:扣款返回失败 9:仓单转移请求 1number;
-            //:仓单转移返回成功 11:仓单转移返回失败 12:加钱请求 13:加钱返回成功 14:加钱返回失败 15:解冻仓单头寸请求 16:解冻仓单头寸返回成功 17:解冻仓单头寸返回失败 18:解冻库位请求 19:解冻库位返回成功 2number;
-            //:解冻库位返回失败
-            let result = '--';
-            switch (type) {
-                case 1:
-                    result = '开始';
-                    break;
-                case 2:
-                    result = '结束';
-                    break;
-                case 3:
-                    result = '冻结请求';
-                    break;
-                case 4:
-                    result = '冻结返回成功';
-                    break;
-                case 5:
-                    result = '冻结返回失败';
-                    break;
-                case 6:
-                    result = '扣款请求';
-                    break;
-                case 7:
-                    result = '扣款返回成功';
-                    break;
-                case 8:
-                    result = '扣款返回失败';
-                    break;
-                case 9:
-                    result = '仓单转移请求';
-                    break;
-                case 10:
-                    result = '仓单转移返回成功';
-                    break;
-                case 11:
-                    result = '仓单转移返回失败';
-                    break;
-                case 12:
-                    result = '加钱请求';
-                    break;
-                case 13:
-                    result = '加钱返回成功';
-                    break;
-                case 14:
-                    result = '加钱返回失败';
-                    break;
-                case 15:
-                    result = '解冻仓单头寸请求';
-                    break;
-                case 16:
-                    result = '解冻仓单头寸返回成功';
-                    break;
-                case 17:
-                    result = '解冻仓单头寸返回失败';
-                    break;
-                case 18:
-                    result = '解冻库位请求';
-                    break;
-                case 19:
-                    result = '解冻库位返回成功';
-                    break;
-            }
-            return result;
-        }
+        const { performancePlanStepList } = handlePerformancePlanStep(props.selectedRow, true);
         return {
             visible,
             cancel,
             performancePlanStepList,
             columns,
-            getStatus,
+            getPerformanceStatusName,
         };
     },
 });

+ 3 - 2
src/views/order/performance_information/components/components/setup.ts

@@ -3,12 +3,13 @@ import { QueryWrPerformancePlanStepReq, WrPerformancePlan, WrPerformancePlanStep
 import { ref } from "vue";
 
 // 获取当前履约步骤
-export function handlePerformancePlanStep(selectedRow: WrPerformancePlan) {
+export function handlePerformancePlanStep(selectedRow: WrPerformancePlan, isAll = false) {
     const performancePlanStep = ref<WrPerformancePlanStep>()
     const performancePlanStepList = ref<WrPerformancePlanStep[]>([])
 
     const stepamount = ref<string>('--')
-    const param: QueryWrPerformancePlanStepReq = { planid: selectedRow.performanceplanid, curstepid: selectedRow.curstepid }
+
+    const param: QueryWrPerformancePlanStepReq = isAll ? { planid: selectedRow.performanceplanid } : { planid: selectedRow.performanceplanid, curstepid: selectedRow.curstepid }
     queryWrPerformancePlanStep(param).then(res => {
         console.log('获取当前履约步骤', res)
         if (res.length) {