li.shaoyi 1 éve
szülő
commit
5d51a4105a

+ 7 - 7
src/packages/mobile/views/order/position/components/goods/detail/Index.vue

@@ -43,9 +43,9 @@
                                 </li>
                             </ul>
                         </div>
-                        <!-- <div class="g-order-list__btnbar" v-if="item.trademode === 50 && item.holderqty">
+                        <div class="g-order-list__btnbar" v-if="item.trademode === 50 && item.holderqty">
                             <Button size="small" @click="showComponent('close', item)" round>转让</Button>
-                        </div> -->
+                        </div>
                     </div>
                 </div>
             </app-pull-refresh>
@@ -82,14 +82,14 @@ const { dataList, loading, run } = useRequest(queryTradeHolderDetail, {
 const selectedRow = shallowRef<Model.TradeHolderDetailRsp>()
 const pullRefreshRef = shallowRef()
 
-const { componentRef, componentId, closeComponent } = useComponent(() => {
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
     pullRefreshRef.value?.refresh()
 })
 
-// const showComponent = (componentName: string, row: Model.TradeHolderDetailRsp) => {
-//     selectedRow.value = row
-//     openComponent(componentName)
-// }
+const showComponent = (componentName: string, row: Model.TradeHolderDetailRsp) => {
+    selectedRow.value = row
+    openComponent(componentName)
+}
 
 // 关闭弹窗
 const closed = (isRefresh = false) => {

+ 54 - 0
src/packages/pc/components/modules/address/index.vue

@@ -0,0 +1,54 @@
+<!-- 账户管理-收货地址管理 -->
+<template>
+    <app-drawer title="收货地址" :width="600" v-model:show="showModal" :loading="loading">
+        <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading" :highlight-current-row="false">
+            <template #radio="{ index }">
+                <el-radio :label="index" v-model="radio" @change="onChange">
+                    <span></span>
+                </el-radio>
+            </template>
+            <!-- 收货地址 -->
+            <template #address="{ row }">
+                {{ [row.provincename, row.cityname, row.districtname, row.address].join(' ') }}
+            </template>
+        </app-table>
+    </app-drawer>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, toRaw, computed } from 'vue'
+import { useRequest } from '@/hooks/request'
+import { queryUserReceiveInfo } from '@/services/api/user'
+import AppDrawer from '@pc/components/base/drawer/index.vue'
+import AppTable from '@pc/components/base/table/index.vue'
+
+const props = defineProps({
+    show: {
+        type: Boolean,
+        default: false
+    }
+})
+
+const emit = defineEmits(['change', 'update:show'])
+const radio = shallowRef()
+
+const showModal = computed({
+    get: () => props.show,
+    set: (val) => emit('update:show', val)
+})
+
+const { loading, dataList } = useRequest(queryUserReceiveInfo)
+
+const tableColumns = shallowRef<Model.TableColumn[]>([
+    { prop: 'radio', label: '选择', width: 80 },
+    { prop: 'receivername', label: '收货人' },
+    { prop: 'phonenum', label: '联系电话' },
+    { prop: 'address', label: '收货地址' },
+])
+
+const onChange = (index: number) => {
+    const record = dataList.value[index]
+    emit('change', toRaw(record))
+    showModal.value = false
+}
+</script>

+ 1 - 1
src/packages/pc/views/footer/goods/detail/index.vue

@@ -61,7 +61,7 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'tradeid', label: '成交单号' },
     { prop: 'marketname', label: '市场' },
     { prop: 'tradetime', label: '交易时间' },
-    // { prop: 'operate', label: '操作', fixed: 'right', width: 100 },
+    { prop: 'operate', label: '操作', fixed: 'right', width: 100 },
 ])
 
 // 接收头寸变化通知通知

+ 6 - 17
src/packages/pc/views/footer/goods/position/components/delivery50/index.vue

@@ -44,22 +44,13 @@
             <el-form-item class="el-form-item--row" prop="DeliveryInfo" label="收货地址">
                 <div class="el-form-item--col">
                     <el-input type="textarea" placeholder="请输入收货地址" :rows="3" v-model="formData.DeliveryInfo" />
-                    <el-dropdown trigger="click" v-if="addressList.length">
-                        <el-icon :size="20" style="cursor: pointer;">
-                            <CirclePlusFilled />
-                        </el-icon>
-                        <template #dropdown>
-                            <el-dropdown-menu>
-                                <el-dropdown-item v-for="(item, index) in addressList" :key="index"
-                                    @click="onAddressChange(item)">
-                                    {{ [item.provincename, item.cityname, item.districtname, item.address].join(' ') }}
-                                </el-dropdown-item>
-                            </el-dropdown-menu>
-                        </template>
-                    </el-dropdown>
+                    <el-icon :size="20" style="cursor: pointer;" @click="showAddress = true">
+                        <CirclePlusFilled />
+                    </el-icon>
                 </div>
             </el-form-item>
         </el-form>
+        <app-address v-model:show="showAddress" @change="onAddressChange" />
         <template #footer>
             <el-button type="info" @click="onCancel(false)">取消</el-button>
             <el-button type="primary" @click="onSubmit">交收</el-button>
@@ -70,12 +61,11 @@
 <script lang="ts" setup>
 import { ref, PropType } from 'vue'
 import { ElMessage, FormInstance, FormRules } from 'element-plus'
-import { useRequest } from '@/hooks/request'
 import { useOfflineDelivery } from '@/business/trade'
-import { queryUserReceiveInfo } from '@/services/api/user'
 import { getBuyOrSellName } from '@/constants/order'
 import { formatDecimal } from '@/filters'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
+import AppAddress from '@pc/components/modules/address/index.vue'
 
 const props = defineProps({
     selectedRow: {
@@ -90,10 +80,9 @@ const props = defineProps({
 const { formSubmit, formData, loading } = useOfflineDelivery()
 const show = ref(true)
 const refresh = ref(false)
+const showAddress = ref(false)
 const formRef = ref<FormInstance>()
 
-const { dataList: addressList } = useRequest(queryUserReceiveInfo)
-
 // 表单验证规则
 const formRules: FormRules = {
     DeliveryLot: [{