Commit cf88bbfff3b6cbf676cadd3915c317b36c818be0

Authored by 史婷婷
1 parent 0055aa6f

feat: 订单-关联表

... ... @@ -66,3 +66,13 @@ export function confirmApi(id) {
66 66 contentType: ContentTypeEnum.FORM_URLENCODED
67 67 })
68 68 }
  69 +
  70 +// 通过订单ID查询变更记录部分数据
  71 +export function loadOrderApi(ids) {
  72 + return request({
  73 + url: `/selector/order/load`,
  74 + method: 'post',
  75 + data: ids,
  76 + contentType: ContentTypeEnum.JSON
  77 + })
  78 +}
\ No newline at end of file
... ...
... ... @@ -60,8 +60,8 @@ export function listCanRevokeOrChangeOrderInfo(params) {
60 60 url: `${baseUrl}/listCanRevokeOrChangeOrderInfo`,
61 61 method: 'get',
62 62 params: {
63   - params,
  63 + ...params,
64 64 },
65   - contentType: ContentTypeEnum.FORM_URLENCODED
66 65 })
67 66 }
  67 +
... ...
... ... @@ -40,6 +40,7 @@
40 40 import CardList from '@/components/card/index.vue'
41 41 import { customerQueryApi } from '@/api/devManage.js'
42 42 import { userSelector } from '@/api/system/user.js'
  43 +import { listCanRevokeOrChangeOrderInfo } from '@/api/order_list.js'
43 44
44 45 export default {
45 46 name: 'RelateSelectSheet',
... ... @@ -52,6 +53,8 @@ export default {
52 53 // 如果未提供 fetchFn,可通过 source 指定内置数据源:'customer' | 'user'
53 54 source: { type: String, default: '' },
54 55 fetchFn: { type: Function, default: null },
  56 + // 为内置数据源传递额外参数,如 { queryType: 'CHANGE' }
  57 + sourceExtra: { type: Object, default: () => ({}) },
55 58 pageSize: { type: Number, default: 10 },
56 59 multiple: { type: Boolean, default: false },
57 60 rowKey: { type: String, default: 'id' },
... ... @@ -108,6 +111,8 @@ export default {
108 111 open() {
109 112 this.$refs.popup && this.$refs.popup.open()
110 113 this.$emit('update:visible', true)
  114 + // 合并外部传入的额外参数
  115 + this.listExtra = { ...this.listExtra, ...this.sourceExtra }
111 116 },
112 117 close() {
113 118 this.$refs.popup && this.$refs.popup.close()
... ... @@ -140,6 +145,17 @@ export default {
140 145 const hasNext = _data.hasNext || false
141 146 return { records, totalCount, hasNext }
142 147 })
  148 + } else if (this.source === 'orderAssoc') {
  149 + // 订单关联表(可撤销/变更的订货单)
  150 + const queryType = (extra && extra.queryType) || ''
  151 + const params = { pageIndex, pageSize, orderNo: name, queryType }
  152 + return listCanRevokeOrChangeOrderInfo(params).then(res => {
  153 + const _data = res.data || {}
  154 + const records = _data.datas || _data.records || _data.list || []
  155 + const totalCount = _data.totalCount || _data.count || 0
  156 + const hasNext = _data.hasNext || false
  157 + return { records, totalCount, hasNext }
  158 + })
143 159 }
144 160 } catch (e) {
145 161 return Promise.resolve({ records: [], totalCount: 0, hasNext: false })
... ... @@ -233,6 +249,6 @@ export default {
233 249 }
234 250 }
235 251 .row { display: flex; gap: 16rpx; margin-bottom: 12rpx; &:last-child { margin-bottom: 0; } }
236   -.label { color: rgba(0,0,0,0.6); }
237   -.value { color: rgba(0,0,0,0.9); }
238   -</style>
\ No newline at end of file
  252 +.label { color: rgba(0,0,0,0.6); width: 150rpx; }
  253 +.value { color: rgba(0,0,0,0.9); flex: 1; }
  254 +</style>
... ...