cloudroam
2025-03-28 cef2bb0eeeb91a22860cf5d23c7348af1ba921dc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<template>
  <el-bus-crud v-bind="tableConfig" />
</template>
 
<script>
export default {
  data() {
    return {
      tableConfig: {
        url: 'flower/api/station/page',
        newUrl: 'flower/api/station/add',
        editUrl: 'flower/api/station/update',
        deleteUrl: 'flower/api/station/delete',
        deleteOnPath: true,
        deleteMethodType: 'post',
        operationAttrs: {
          width: 150,
          fixed: 'right',
        },
        columns: [
          { label: '集货站名称', prop: 'name', minWidth: 150, fixed: 'left' },
          { label: '集货站类型', prop: 'typeStr', minWidth: 100 },
          { label: '地址', prop: 'address', minWidth: 200 },
          { label: '运费(元)', prop: 'freight', minWidth: 100 },
          { label: '质检人员', prop: 'userNames', minWidth: 150 },
          { label: '联系人', prop: 'contactName', minWidth: 100 },
          { label: '联系方式', prop: 'contactTel', minWidth: 120 },
        ],
        searchForm: [
          {
            type: 'row',
            items: [{ label: '集货站名称', id: 'name', type: 'input' }],
          },
        ],
        form: [
          {
            label: '集货站名称:',
            id: 'name',
            type: 'input',
            rules: {
              required: true,
              message: '请输入集货站名称',
              trigger: 'blur',
            },
          },
          {
            label: '集货站类型:',
            id: 'type',
            type: 'bus-radio',
            el: {
              code: 'station_type',
              style: 'width:100%',
            },
            str: true,
            rules: { required: true, message: '请选择集货站类型' },
            on: {
              change: (e, updateForm) => {
                updateForm({ freight: undefined })
              },
            },
          },
          {
            label: '集货站地址:',
            id: 'address',
            type: 'input',
            rules: {
              required: true,
              message: '请输入集货站地址',
              trigger: 'blur',
            },
          },
          {
            label: '运费:',
            id: 'freight',
            type: 'input-number',
            el: {
              controls: false,
              min: 0,
              precision: 2,
            },
            unit: '元',
            rules: { required: true, message: '请输入运费', trigger: 'blur' },
            hidden: (row) => row.type !== '1',
          },
          {
            label: '质检人员:',
            id: 'userIds',
            type: 'bus-select',
            el: {
              interfaceUri: 'flower/api/user/list',
              extraQuery: {
                current: 1,
                size: 2000,
              },
              props: {
                label: 'nickName',
                value: 'id',
                dataPath: 'records',
              },
              filterable: true,
              multiple: true,
              style: 'width:100%',
            },
            inputFormat: (row) => {
              if ('userIds' in row) {
                return row.userIds ? row.userIds.split(',') : []
              }
            },
            outputFormat: (val) => {
              return Array.isArray(val) && val.length > 0 ? val.join(',') : null
            },
            str: true,
            strKey: 'userNames',
            rules: { required: true, message: '请选择质检人员' },
          },
          {
            label: '联系人:',
            id: 'contactName',
            type: 'input',
            rules: {
              required: true,
              message: '请输入联系人',
              trigger: 'blur',
            },
          },
          {
            label: '联系方式:',
            id: 'contactTel',
            type: 'input',
            rules: {
              required: true,
              message: '请输入联系方式',
              trigger: 'blur',
            },
          },
        ],
      },
    }
  },
  head() {
    return {
      title: '集货站管理',
    }
  },
}
</script>