doctor-admin-components 1.0.14-beta.87 → 1.0.14-beta.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,12 +16,13 @@ npm install
16
16
  ```
17
17
 
18
18
  #### 1 把公共模块链接到全局
19
+
19
20
  ```
20
21
  sudo npm link
21
22
  ```
22
23
 
24
+ #### 2 把公共模块链接到项目中
23
25
 
24
- #### 2 把公共模块链接到项目中
25
26
  ```
26
27
  npm link doctor-admin-components --legacy-peer-deps
27
28
  ```
@@ -34,15 +35,15 @@ npm unlink doctor-admin-components --legacy-peer-deps
34
35
 
35
36
  ### 发布包
36
37
 
37
- 1登录npm账号
38
- 确保是npm镜像
39
- nrm ls 查看镜像列表
40
- npm ---------- https://registry.npmjs.org/
41
- yarn --------- https://registry.yarnpkg.com/
42
- tencent ------ https://mirrors.cloud.tencent.com/npm/
43
- cnpm --------- https://r.cnpmjs.org/
44
- taobao ------- https://registry.npmmirror.com/
45
- npmMirror ---- https://skimdb.npmjs.com/registry/
38
+ 1 登录 npm 账号
39
+ 确保是 npm 镜像
40
+ nrm ls 查看镜像列表
41
+ npm ---------- https://registry.npmjs.org/
42
+ yarn --------- https://registry.yarnpkg.com/
43
+ tencent ------ https://mirrors.cloud.tencent.com/npm/
44
+ cnpm --------- https://r.cnpmjs.org/
45
+ taobao ------- https://registry.npmmirror.com/
46
+ npmMirror ---- https://skimdb.npmjs.com/registry/
46
47
  nrm use npm
47
48
 
48
49
  npm login
@@ -51,14 +52,39 @@ Username: xizaozao
51
52
  Password: 15839493300abc
52
53
  Email: (this IS public) 3316756985@qq.com
53
54
  如果出现这个:联系我
54
- Enter one-time password:
55
+ Enter one-time password:
55
56
 
56
57
  2 发布
57
- 修改package.json里的 version
58
- 调试版本格式:"1.0.0-beta.11"
59
- npm publish --tag=beta
58
+ 修改 package.json 里的 version
59
+ 调试版本格式:"1.0.0-beta.11"
60
+ npm publish --tag=beta
61
+
60
62
  ```
61
63
 
62
64
 
63
65
  3 拉取最新版本镜像 点击同步 可能会有延迟
64
- https://npmmirror.com/package/doctor-admin-components/versions?version=1.0.14-beta.72
66
+ https://npmmirror.com/package/doctor-admin-components/versions?version=1.0.14-beta.72
67
+
68
+
69
+ 4.认证发布(登录和发布 均通过打开浏览器进行认证):
70
+ tyzl@tyzl-zxx-m1pro common-components % node -v
71
+ v20.19.3
72
+
73
+ tyzl@tyzl-zxx-m1pro common-components % npm login
74
+ npm notice Log in on https://registry.npmjs.org/
75
+ Login at:
76
+ https://www.npmjs.com/login?next=/login/cli/f6b5899d-e811-4a84-adc5-90fc2413ff31
77
+ Press ENTER to open in the browser...
78
+
79
+ Logged in on https://registry.npmjs.org/.
80
+ tyzl@tyzl-zxx-m1pro common-components % npm publish --tag=beta
81
+
82
+
83
+ npm notice
84
+ npm notice Publishing to https://registry.npmjs.org/ with tag beta and default access
85
+ Authenticate your account at:
86
+ https://www.npmjs.com/auth/cli/4e0a2c7a-6e12-4ca1-9462-5f8ec27e418e
87
+ Press ENTER to open in the browser...
88
+
89
+ + doctor-admin-components@1.0.14-beta.86
90
+ ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "doctor-admin-components",
3
3
  "version1": "1.0.11",
4
- "version": "1.0.14-beta.87",
4
+ "version": "1.0.14-beta.89",
5
5
  "private": false,
6
6
  "main1": "lib/index.umd.min.js",
7
7
  "main": "packages/index.js",
package/packages/index.js CHANGED
@@ -57,9 +57,8 @@ import {
57
57
  FileShow,
58
58
  ShipmentPurchaseAmount,
59
59
  ContractClause,
60
- ContractInfo
61
-
62
-
60
+ ContractInfo,
61
+ SendGroupSelect
63
62
  } from "./src";
64
63
  // 组件列表
65
64
  const components = [
@@ -76,7 +75,8 @@ const components = [
76
75
  FileShow,
77
76
  ShipmentPurchaseAmount,
78
77
  ContractClause,
79
- ContractInfo
78
+ ContractInfo,
79
+ SendGroupSelect
80
80
  ];
81
81
 
82
82
  // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,那么所有的组件都会被注册
@@ -152,5 +152,6 @@ export default {
152
152
  FileShow,
153
153
  ShipmentPurchaseAmount,
154
154
  ContractClause,
155
- ContractInfo
155
+ ContractInfo,
156
+ SendGroupSelect
156
157
  };
@@ -8,6 +8,13 @@ export function listBizShipment(query) {
8
8
  params: query
9
9
  })
10
10
  }
11
+ export function getBalanceInvoice(data) {
12
+ return request({
13
+ url: '/biz/invoice/balanceInvoice',
14
+ method: 'post',
15
+ data: data
16
+ })
17
+ }
11
18
 
12
19
  // 查询装运详细
13
20
  export function getBizShipment(shipmentId) {
@@ -13,70 +13,74 @@
13
13
  // export { default as ContractTracingDetail } from './views/biz/contractTracing/contractTracingDetail.vue';
14
14
  // // export { default as Test } from './views/test.vue111111111111';
15
15
 
16
- import ContractTracingDetail from "./views/biz/contractTracing/contractTracingDetail.vue";
17
- import Claim from "./views/biz/claim/Claim.vue";
18
- import PurchaseInvoiceUpload from "./views/biz/contractTracing/purchaseInvoiceUpload.vue";
19
- import BizShipmentAdd from "./views/biz/bizShipment/add.vue";
20
- import ContractChangeLog from "./views/biz/contractTracing/contractChangeLog.vue";
21
- import EditBill from "./views/biz/contractTracing/editBill.vue";
22
- import CompanyBanks from "./views/biz/contractTracing/companyBanks.vue";
23
- import VDistpicker from "./views/components/RegionPicker/Distpicker.vue";
24
- import ContractFileDragUpload from '../src/components/FileUpload/contract-drag-new.vue';
25
- import FileShow from '../src/views/biz/bizFileInfo/fileShow.vue'
16
+ import ContractTracingDetail from './views/biz/contractTracing/contractTracingDetail.vue'
17
+ import Claim from './views/biz/claim/Claim.vue'
18
+ import PurchaseInvoiceUpload from './views/biz/contractTracing/purchaseInvoiceUpload.vue'
19
+ import BizShipmentAdd from './views/biz/bizShipment/add.vue'
20
+ import ContractChangeLog from './views/biz/contractTracing/contractChangeLog.vue'
21
+ import EditBill from './views/biz/contractTracing/editBill.vue'
22
+ import CompanyBanks from './views/biz/contractTracing/companyBanks.vue'
23
+ import VDistpicker from './views/components/RegionPicker/Distpicker.vue'
24
+ import ContractFileDragUpload from '../src/components/FileUpload/contract-drag-new.vue'
25
+ import FileShow from '../src/views/biz/bizFileInfo/fileShow.vue'
26
26
  import ShipmentPurchaseAmount from '../src/views/biz/contractTracing/shipmentPurchaseAmount.vue'
27
27
  import ContractClause from '../src/views/biz/contractTracing/contractClause.vue'
28
28
  import ContractInfo from '../src/views/biz/contractTracing/info.vue'
29
+ import SendGroupSelect from '../src/views/biz/SendGroupSelect/index.vue'
29
30
 
30
31
  // 为组件提供 install 安装方法,供按需引入
31
32
 
32
33
  ContractTracingDetail.install = function (Vue) {
33
- Vue.component(ContractTracingDetail.name, ContractTracingDetail);
34
- };
34
+ Vue.component(ContractTracingDetail.name, ContractTracingDetail)
35
+ }
35
36
 
36
37
  Claim.install = function (Vue) {
37
- Vue.component(Claim.name, Claim);
38
- };
38
+ Vue.component(Claim.name, Claim)
39
+ }
39
40
 
40
41
  PurchaseInvoiceUpload.install = function (Vue) {
41
- Vue.component(PurchaseInvoiceUpload.name, PurchaseInvoiceUpload);
42
- };
42
+ Vue.component(PurchaseInvoiceUpload.name, PurchaseInvoiceUpload)
43
+ }
43
44
 
44
45
  BizShipmentAdd.install = function (Vue) {
45
- Vue.component(BizShipmentAdd.name, BizShipmentAdd);
46
- };
46
+ Vue.component(BizShipmentAdd.name, BizShipmentAdd)
47
+ }
47
48
 
48
49
  ContractChangeLog.install = function (Vue) {
49
- Vue.component(ContractChangeLog.name, ContractChangeLog);
50
- };
50
+ Vue.component(ContractChangeLog.name, ContractChangeLog)
51
+ }
51
52
 
52
53
  EditBill.install = function (Vue) {
53
- Vue.component(EditBill.name, EditBill);
54
- };
54
+ Vue.component(EditBill.name, EditBill)
55
+ }
55
56
 
56
57
  CompanyBanks.install = function (Vue) {
57
- Vue.component(CompanyBanks.name, CompanyBanks);
58
- };
58
+ Vue.component(CompanyBanks.name, CompanyBanks)
59
+ }
59
60
 
60
61
  VDistpicker.install = function (Vue) {
61
- Vue.component(CompanyBanks.name, CompanyBanks);
62
- };
62
+ Vue.component(CompanyBanks.name, CompanyBanks)
63
+ }
63
64
  ContractFileDragUpload.install = function (Vue) {
64
- Vue.component(ContractFileDragUpload.name, ContractFileDragUpload);
65
- };
65
+ Vue.component(ContractFileDragUpload.name, ContractFileDragUpload)
66
+ }
66
67
 
67
68
  FileShow.install = function (Vue) {
68
- Vue.component(FileShow.name, FileShow);
69
- };
69
+ Vue.component(FileShow.name, FileShow)
70
+ }
70
71
 
71
72
  ShipmentPurchaseAmount.install = function (Vue) {
72
- Vue.component(ShipmentPurchaseAmount.name, ShipmentPurchaseAmount);
73
- };
73
+ Vue.component(ShipmentPurchaseAmount.name, ShipmentPurchaseAmount)
74
+ }
74
75
  ContractClause.install = function (Vue) {
75
- Vue.component(ContractClause.name, ContractClause);
76
- };
76
+ Vue.component(ContractClause.name, ContractClause)
77
+ }
77
78
  ContractInfo.install = function (Vue) {
78
- Vue.component(ContractInfo.name, ContractInfo);
79
- };
79
+ Vue.component(ContractInfo.name, ContractInfo)
80
+ }
81
+ SendGroupSelect.install = function (Vue) {
82
+ Vue.component(SendGroupSelect.name, SendGroupSelect)
83
+ }
80
84
 
81
85
  // 导出组件
82
86
  export {
@@ -92,5 +96,6 @@ export {
92
96
  FileShow,
93
97
  ShipmentPurchaseAmount,
94
98
  ContractClause,
95
- ContractInfo
96
- };
99
+ ContractInfo,
100
+ SendGroupSelect
101
+ }
@@ -0,0 +1,492 @@
1
+ <template>
2
+ <div class="send-group-select">
3
+ <div class="section-title">
4
+ <span>{{ title }}</span>
5
+ <el-tag size="small" type="info">已选 {{ selectedGroupIds.length }} 个</el-tag>
6
+ </div>
7
+
8
+ <div class="group-select-row">
9
+ <el-row :gutter="16" type="flex" align="stretch">
10
+ <el-col v-if="filterable" :span="6">
11
+ <div class="filter-panel">
12
+ <div v-for="filter in normalizedFilters" :key="filter.key" class="filter-block">
13
+ <div class="filter-label">{{ filter.label }}</div>
14
+ <template v-if="filter.options.length > 3">
15
+ <el-select
16
+ v-if="!filter.isTree"
17
+ v-model="localSelectedFilters[filter.key]"
18
+ :multiple="true"
19
+ placeholder="请选择"
20
+ @change="onFilterChange"
21
+ class="filter-select"
22
+ >
23
+ <el-option v-for="item in filter.options" :key="item.value" :label="item.label" :value="item.value" />
24
+ </el-select>
25
+ <el-cascader
26
+ v-else
27
+ v-model="localSelectedFilters[filter.key]"
28
+ :options="filter.options"
29
+ :props="{
30
+ multiple: true,
31
+ label: 'dictLabel',
32
+ value: 'id',
33
+ children: 'children',
34
+ emitPath: false
35
+ }"
36
+ placeholder="请选择"
37
+ :show-all-levels="false"
38
+ clearable
39
+ filterable
40
+ @change="onFilterChange"
41
+ class="filter-select"
42
+ />
43
+ </template>
44
+ <template v-else>
45
+ <el-checkbox
46
+ v-for="item in filter.options"
47
+ :key="item.value"
48
+ :value="localSelectedFilters[filter.key] && localSelectedFilters[filter.key].includes(item.value)"
49
+ @change="toggleFilter(filter.key, item.value)"
50
+ >
51
+ {{ item.label }}
52
+ </el-checkbox>
53
+ </template>
54
+ </div>
55
+
56
+ <div class="filter-footer">
57
+ <el-button type="text" @click="clearFilters">清空筛选</el-button>
58
+ </div>
59
+ </div>
60
+ </el-col>
61
+
62
+ <el-col :span="filterable ? 18 : 24">
63
+ <div v-loading="groupLoading" class="transfer-container">
64
+ <el-transfer
65
+ v-model="selectedGroupIds"
66
+ :data="transferGroups"
67
+ :titles="['可选群', '已选群']"
68
+ :filterable="true"
69
+ filter-placeholder="搜索群"
70
+ :filter-method="handleTransferFilter"
71
+ :props="{
72
+ key: 'groupId',
73
+ label: 'toolsName'
74
+ }"
75
+ >
76
+ <span slot-scope="{ option }">
77
+ <span class="group-name">{{ option.toolsName }}</span>
78
+ <el-tag v-for="tag in option.filterTags" :key="tag.type" size="mini" class="group-tag" :type="getTagType(tag.type)">
79
+ {{ tag.label }}
80
+ </el-tag>
81
+ </span>
82
+ </el-transfer>
83
+ </div>
84
+ </el-col>
85
+ </el-row>
86
+ </div>
87
+
88
+ <div class="group-footer">
89
+ <span>匹配到 {{ transferGroups.length }} 个群,共 {{ groupTotal }} 个群</span>
90
+ </div>
91
+ </div>
92
+ </template>
93
+
94
+ <script>
95
+ import request from '@/utils/request'
96
+
97
+ export default {
98
+ name: 'SendGroupSelect',
99
+ dicts: ['customer_grade', 'group_type'],
100
+ props: {
101
+ value: {
102
+ type: Array,
103
+ default: () => []
104
+ },
105
+ url: {
106
+ type: String,
107
+ required: true
108
+ },
109
+ filters: {
110
+ type: Array,
111
+ default: () => []
112
+ },
113
+ title: {
114
+ type: String,
115
+ default: '发送群'
116
+ },
117
+ pageSize: {
118
+ type: Number,
119
+ default: 1000000
120
+ },
121
+ requestMethod: {
122
+ type: String,
123
+ default: 'post'
124
+ },
125
+ requestParams: {
126
+ type: Object,
127
+ default: () => ({})
128
+ },
129
+ filterValues: {
130
+ type: Object,
131
+ default: () => ({})
132
+ },
133
+ filterable: {
134
+ type: Boolean,
135
+ default: true
136
+ },
137
+ groupTypeFilter: {
138
+ type: Function,
139
+ default: null
140
+ }
141
+ },
142
+ data() {
143
+ return {
144
+ selectedGroupIds: [...this.value],
145
+ localSelectedFilters: {},
146
+ groupLoading: false,
147
+ groupTotal: 0,
148
+ allGroups: [],
149
+ groups: []
150
+ }
151
+ },
152
+ computed: {
153
+ selectedFilters() {
154
+ if (Object.keys(this.filterValues).length > 0) {
155
+ return this.filterValues
156
+ }
157
+ return this.localSelectedFilters
158
+ },
159
+ normalizedFilters() {
160
+ return this.filters
161
+ .map((filter) => {
162
+ let options = filter.options || []
163
+ if (!filter.isTree) {
164
+ options = options.map((item) => (typeof item === 'object' ? item : { label: item, value: item }))
165
+ }
166
+ return {
167
+ ...filter,
168
+ key: filter.key,
169
+ label: filter.label,
170
+ options
171
+ }
172
+ })
173
+ .sort((a, b) => {
174
+ const aLen = a.options.length
175
+ const bLen = b.options.length
176
+ const aLess3 = aLen <= 3
177
+ const bLess3 = bLen <= 3
178
+ if (aLess3 && !bLess3) return -1
179
+ if (!aLess3 && bLess3) return 1
180
+ return 0
181
+ })
182
+ },
183
+ transferGroups() {
184
+ return this.groups.map((group) => ({
185
+ groupId: group.groupId,
186
+ toolsName: group.toolsName,
187
+ filterTags: this.getFilterTagsForGroup(group)
188
+ }))
189
+ },
190
+ selectedGroups() {
191
+ return this.allGroups.filter((item) => this.selectedGroupIds.includes(item.groupId))
192
+ }
193
+ },
194
+ watch: {
195
+ value: {
196
+ handler(val) {
197
+ if (this.isSameList(val || [], this.selectedGroupIds)) {
198
+ return
199
+ }
200
+ this.selectedGroupIds = [...(val || [])]
201
+ this.applyFilters()
202
+ },
203
+ deep: true
204
+ },
205
+ selectedGroupIds: {
206
+ handler(val) {
207
+ this.$emit('input', val)
208
+ this.emitSelectedGroups()
209
+ this.applyFilters()
210
+ },
211
+ deep: true
212
+ },
213
+ filterValues: {
214
+ handler() {
215
+ this.applyFilters()
216
+ },
217
+ deep: true
218
+ },
219
+ filters: {
220
+ handler() {
221
+ this.initSelectedFilters()
222
+ this.applyFilters()
223
+ },
224
+ deep: true
225
+ },
226
+ url() {
227
+ this.loadGroupList()
228
+ },
229
+ requestParams: {
230
+ handler() {
231
+ this.loadGroupList()
232
+ },
233
+ deep: true
234
+ }
235
+ },
236
+ created() {
237
+ this.initSelectedFilters()
238
+ this.loadGroupList()
239
+ },
240
+ methods: {
241
+ isSameList(left, right) {
242
+ if (left.length !== right.length) {
243
+ return false
244
+ }
245
+ return left.every((item, index) => item === right[index])
246
+ },
247
+ initSelectedFilters() {
248
+ const next = {}
249
+ this.normalizedFilters.forEach((filter) => {
250
+ next[filter.key] = this.localSelectedFilters[filter.key] || []
251
+ })
252
+ this.localSelectedFilters = next
253
+ },
254
+ loadGroupList() {
255
+ this.groupLoading = true
256
+ this.allGroups = []
257
+ this.groups = []
258
+ this.groupTotal = 0
259
+
260
+ const params = {
261
+ pageNum: 1,
262
+ pageSize: this.pageSize,
263
+ orderByColumn: 'toolsGroupId',
264
+ isAsc: 'desc',
265
+ ...this.requestParams
266
+ }
267
+
268
+ return request({
269
+ url: this.buildRequestUrl(params),
270
+ method: this.requestMethod,
271
+ data: params,
272
+ params: this.requestMethod.toLowerCase() === 'get' ? params : undefined
273
+ })
274
+ .then((response) => {
275
+ const data = response.data || {}
276
+ this.allGroups = data.rows
277
+ this.groupTotal = Number(data.total) || 0
278
+ this.applyFilters()
279
+ this.emitSelectedGroups()
280
+ })
281
+ .catch(() => {})
282
+ .finally(() => {
283
+ this.groupLoading = false
284
+ })
285
+ },
286
+ buildRequestUrl(params) {
287
+ if (this.requestMethod.toLowerCase() !== 'post') {
288
+ return this.url
289
+ }
290
+ const joiner = this.url.includes('?') ? '&' : '?'
291
+ return `${this.url}${joiner}pageNum=${params.pageNum}&pageSize=${params.pageSize}&orderByColumn=${params.orderByColumn}&isAsc=${params.isAsc}`
292
+ },
293
+ applyFilters() {
294
+ const filteredGroups = this.allGroups.filter((group) => {
295
+ return this.normalizedFilters.every((filter) => this.matchFilter(group, filter))
296
+ })
297
+
298
+ const selectedGroups = this.allGroups.filter((group) => this.selectedGroupIds.includes(group.groupId))
299
+ this.groups = [...new Map([...selectedGroups, ...filteredGroups].map((item) => [item.groupId, item])).values()]
300
+ },
301
+ matchFilter(group, filter) {
302
+ const selected = this.selectedFilters[filter.key] || []
303
+ if (selected.length === 0) {
304
+ return true
305
+ }
306
+
307
+ if (filter.key === 'groupTypeList' && this.groupTypeFilter) {
308
+ return this.groupTypeFilter(group, selected)
309
+ }
310
+
311
+ const rawField = filter.field || filter.key
312
+ const groupValue = group[rawField]
313
+
314
+ if (filter.isTree) {
315
+ const selectedIds = selected.map(String)
316
+ const groupIds = Array.isArray(groupValue) ? groupValue.map(String) : [String(groupValue)]
317
+ return selectedIds.some((id) => groupIds.includes(id))
318
+ }
319
+
320
+ if (Array.isArray(groupValue)) {
321
+ return groupValue.some((val) => selected.includes(val))
322
+ }
323
+ return selected.includes(groupValue)
324
+ },
325
+ toggleFilter(key, value) {
326
+ const list = [...(this.localSelectedFilters[key] || [])]
327
+ const index = list.indexOf(value)
328
+ if (index > -1) {
329
+ list.splice(index, 1)
330
+ } else {
331
+ list.push(value)
332
+ }
333
+ this.$set(this.localSelectedFilters, key, list)
334
+ this.onFilterChange()
335
+ },
336
+ clearFilters() {
337
+ Object.keys(this.localSelectedFilters).forEach((key) => {
338
+ this.$set(this.localSelectedFilters, key, [])
339
+ })
340
+ this.onFilterChange()
341
+ },
342
+ onFilterChange() {
343
+ this.applyFilters()
344
+ this.$emit('filter-change', this.selectedFilters)
345
+ },
346
+ handleTransferFilter(query, item) {
347
+ return item.toolsName.toLowerCase().includes(query.toLowerCase())
348
+ },
349
+ emitSelectedGroups() {
350
+ this.$emit('selected-change', this.selectedGroups)
351
+ },
352
+ getTagType(filterKey) {
353
+ const typeMap = {
354
+ language: '',
355
+ groupChannel: 'success',
356
+ department: 'warning',
357
+ groupTypeList: 'danger'
358
+ }
359
+ return typeMap[filterKey] || ''
360
+ },
361
+ getFilterTagsForGroup(group) {
362
+ const tags = []
363
+ const checkboxFilters = this.normalizedFilters.filter((filter) => !filter.isTree && filter.options.length <= 3)
364
+ checkboxFilters.forEach((filter) => {
365
+ const rawField = filter.field || filter.key
366
+ const groupValue = group[rawField]
367
+ if (Array.isArray(groupValue)) {
368
+ groupValue.forEach((val) => {
369
+ const option = filter.options.find((opt) => opt.value === val)
370
+ if (option) {
371
+ tags.push({ label: option.label, type: filter.key })
372
+ }
373
+ })
374
+ } else if (groupValue) {
375
+ const option = filter.options.find((opt) => opt.value === groupValue)
376
+ if (option) {
377
+ tags.push({ label: option.label, type: filter.key })
378
+ }
379
+ }
380
+ })
381
+
382
+ return tags
383
+ }
384
+ }
385
+ }
386
+ </script>
387
+
388
+ <style scoped>
389
+ .section-title {
390
+ display: flex;
391
+ align-items: center;
392
+ justify-content: space-between;
393
+ margin-bottom: 16px;
394
+ font-size: 16px;
395
+ font-weight: 600;
396
+ color: #303133;
397
+ }
398
+
399
+ .group-select-row {
400
+ margin-bottom: 12px;
401
+ }
402
+
403
+ .transfer-container {
404
+ min-height: 400px;
405
+ height: 100%;
406
+ overflow-x: auto;
407
+ }
408
+
409
+ .transfer-container ::v-deep .el-transfer {
410
+ display: flex !important;
411
+ flex-direction: row !important;
412
+ flex-wrap: nowrap !important;
413
+ align-items: center !important;
414
+ min-width: 600px;
415
+ }
416
+
417
+ .transfer-container ::v-deep .el-transfer-panel {
418
+ width: 45%;
419
+ min-width: 220px;
420
+ height: 400px;
421
+ }
422
+
423
+ .transfer-container ::v-deep .el-transfer-panel__body {
424
+ height: calc(100% - 60px);
425
+ }
426
+
427
+ .transfer-container ::v-deep .el-transfer-panel__list {
428
+ height: calc(100% - 40px);
429
+ }
430
+
431
+ .transfer-container ::v-deep .el-transfer__buttons {
432
+ padding: 0 10px;
433
+ display: flex !important;
434
+ flex-direction: column !important;
435
+ align-items: center !important;
436
+ }
437
+
438
+ .transfer-container ::v-deep .el-transfer__buttons .el-button {
439
+ margin: 5px 0;
440
+ padding: 8px 10px;
441
+ }
442
+
443
+ .filter-panel {
444
+ width: 100%;
445
+ border: 1px solid #ebeef5;
446
+ background: #fafafa;
447
+ border-radius: 8px;
448
+ padding: 14px 16px 10px;
449
+ min-height: 400px;
450
+ display: flex;
451
+ flex-direction: column;
452
+ }
453
+
454
+ .filter-block + .filter-block {
455
+ margin-top: 14px;
456
+ }
457
+
458
+ .filter-label {
459
+ margin-bottom: 8px;
460
+ font-size: 12px;
461
+ font-weight: 600;
462
+ color: #909399;
463
+ }
464
+
465
+ .filter-select {
466
+ width: 100%;
467
+ }
468
+
469
+ .filter-footer {
470
+ margin-top: 12px;
471
+ display: flex;
472
+ justify-content: center;
473
+ align-items: center;
474
+ font-size: 12px;
475
+ color: #909399;
476
+ }
477
+
478
+ .group-footer {
479
+ margin-top: 12px;
480
+ text-align: center;
481
+ color: #909399;
482
+ font-size: 12px;
483
+ }
484
+
485
+ .group-name {
486
+ margin-right: 6px;
487
+ }
488
+
489
+ .group-tag {
490
+ margin-left: 4px;
491
+ }
492
+ </style>
@@ -1303,8 +1303,8 @@
1303
1303
  <el-button type="primary" @click="addShipment">{{ $t('contractDetail.confirm') }}</el-button>
1304
1304
  </span>
1305
1305
  </el-dialog>
1306
- <shipment-add ref="shipmentGen" @refresh="handleRefresh" />
1307
-
1306
+ <shipment-add ref="shipmentGen" @openGenerateLive="openGenerateLive" />
1307
+ <generate-live-open ref="generateLiveOpen"></generate-live-open>
1308
1308
  <shipment-purchase-amount
1309
1309
  ref="shipmentPurchaseAmount"
1310
1310
  :getContractFileInfoCallback="getContractFileInfoCallback"
@@ -1318,6 +1318,7 @@ import {
1318
1318
  chargedShipment,
1319
1319
  getPurchaseAmount,
1320
1320
  } from '../../../api/biz/bizShipment';
1321
+ import GenerateLiveOpen from './generateLiveOpen.vue'
1321
1322
  import { listBizFileInfo, addBizFileInfo } from '../../../api/biz/bizFileInfo';
1322
1323
  import { getBizContractFileInfo } from '../../../api/biz/bizContract';
1323
1324
  import FileShow from './fileShow.vue';
@@ -1362,6 +1363,7 @@ let handleGenerateflag1 = false;
1362
1363
  export default {
1363
1364
  name: 'ContractFile',
1364
1365
  components: {
1366
+ GenerateLiveOpen,
1365
1367
  FileShow,
1366
1368
  ContractFileUpload,
1367
1369
  ContractFileDragUpload,
@@ -1553,6 +1555,9 @@ export default {
1553
1555
  },
1554
1556
  mounted() { },
1555
1557
  methods: {
1558
+ openGenerateLive(shipment) {
1559
+ this.$refs.generateLiveOpen.handleOpen(shipment)
1560
+ },
1556
1561
  async clickAddShipment() {
1557
1562
  //弹出选择框,选择关联的销售合同,点击确定后,执行新增
1558
1563
  const list = this.contract.associationContractList || []
@@ -0,0 +1,214 @@
1
+ <template>
2
+ <div class="">
3
+ <el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
4
+ {{ '报价类型为' + form.quoteType + ',确认用这这个装运单生成尾款发票' }}
5
+ <div slot="footer" class="dialog-footer">
6
+ <el-form :model="form" label-width="100px" :rules="rules" ref="ruleForm">
7
+ <div v-if="form.quoteType !== 'FIXED'">
8
+ <el-row class="bordered-row" v-if="checkDetailListHaveElement('element')">
9
+ <el-col :span="6"><div v-html="getItemName('element')"></div></el-col>
10
+ <el-col :span="18">
11
+ <!-- ag,al,au,bi,co,cu,li,ni,pb,sb,sn,zn -->
12
+ <el-form-item label="LME Ag=" v-if="checkElement('ag')" prop="elementPoint.ag">
13
+ <el-input v-model="form.elementPoint.ag" type="number"></el-input>
14
+ </el-form-item>
15
+ <el-form-item label="LME Al=" v-if="checkElement('al')" prop="elementPoint.al">
16
+ <el-input v-model="form.elementPoint.al" type="number"></el-input>
17
+ </el-form-item>
18
+ <el-form-item label="LME Au=" v-if="checkElement('au')" prop="elementPoint.au">
19
+ <el-input v-model="form.elementPoint.au" type="number"></el-input>
20
+ </el-form-item>
21
+ <el-form-item label="LME Bi=" v-if="checkElement('bi')" prop="elementPoint.bi">
22
+ <el-input v-model="form.elementPoint.bi" type="number"></el-input>
23
+ </el-form-item>
24
+ <el-form-item label="LME Co=" v-if="checkElement('co')" prop="elementPoint.co">
25
+ <el-input v-model="form.elementPoint.co" type="number"></el-input>
26
+ </el-form-item>
27
+ <el-form-item label="LME Cu=" v-if="checkElement('cu')" prop="elementPoint.cu">
28
+ <el-input v-model="form.elementPoint.cu" type="number"></el-input>
29
+ </el-form-item>
30
+ <el-form-item label="LME Li=" v-if="checkElement('li')" prop="elementPoint.li">
31
+ <el-input v-model="form.elementPoint.li" type="number"></el-input>
32
+ </el-form-item>
33
+ <el-form-item label="LME Ni=" v-if="checkElement('ni')" prop="elementPoint.ni">
34
+ <el-input v-model="form.elementPoint.ni" type="number"></el-input>
35
+ </el-form-item>
36
+ <el-form-item label="LME Pb=" v-if="checkElement('pb')" prop="elementPoint.pb">
37
+ <el-input v-model="form.elementPoint.pb" type="number"></el-input>
38
+ </el-form-item>
39
+ <el-form-item label="LME Sb=" v-if="checkElement('sb')" prop="elementPoint.sb">
40
+ <el-input v-model="form.elementPoint.sb" type="number"></el-input>
41
+ </el-form-item>
42
+ <el-form-item label="LME Sn=" v-if="checkElement('sn')" prop="elementPoint.sn">
43
+ <el-input v-model="form.elementPoint.sn" type="number"></el-input>
44
+ </el-form-item>
45
+ <el-form-item label="LME Zn=" v-if="checkElement('zn')" prop="elementPoint.zn">
46
+ <el-input v-model="form.elementPoint.zn" type="number"></el-input>
47
+ </el-form-item>
48
+ </el-col>
49
+ </el-row>
50
+ <el-row class="bordered-row" v-if="checkDetailListHaveElement('unElement')">
51
+ <el-col :span="6"><div v-html="getItemName('unElement')"></div></el-col>
52
+ <el-col :span="18">
53
+ <el-form-item label="临时价格" prop="pointPrice">
54
+ <el-input type="number" v-model="form.pointPrice" placeholder="请输入临时价格" size="small" /> </el-form-item
55
+ ></el-col>
56
+ </el-row>
57
+ </div>
58
+ </el-form>
59
+ <el-button type="primary" @click="submit">确 定</el-button>
60
+ <el-button @click="cancel">取 消</el-button>
61
+ </div>
62
+ </el-dialog>
63
+ </div>
64
+ </template>
65
+ <script>
66
+ import { updateWithContainerAndInvoice, getBalanceInvoice } from '../../../api/biz/bizShipment'
67
+
68
+ export default {
69
+ name: '',
70
+ props: {
71
+ refresh: {
72
+ type: Function,
73
+ default: null
74
+ }
75
+ },
76
+ components: {},
77
+ data() {
78
+ return {
79
+ rules: {
80
+ pointPrice: [{ required: true, message: '请输入', trigger: 'blur' }],
81
+ 'elementPoint.ag': [{ required: true, message: '请输入', trigger: 'blur' }],
82
+ 'elementPoint.al': [{ required: true, message: '请输入', trigger: 'blur' }],
83
+ 'elementPoint.au': [{ required: true, message: '请输入', trigger: 'blur' }],
84
+ 'elementPoint.bi': [{ required: true, message: '请输入', trigger: 'blur' }],
85
+ 'elementPoint.co': [{ required: true, message: '请输入', trigger: 'blur' }],
86
+ 'elementPoint.cu': [{ required: true, message: '请输入', trigger: 'blur' }],
87
+ 'elementPoint.li': [{ required: true, message: '请输入', trigger: 'blur' }],
88
+ 'elementPoint.ni': [{ required: true, message: '请输入', trigger: 'blur' }],
89
+ 'elementPoint.pb': [{ required: true, message: '请输入', trigger: 'blur' }],
90
+ 'elementPoint.sb': [{ required: true, message: '请输入', trigger: 'blur' }],
91
+ 'elementPoint.sn': [{ required: true, message: '请输入', trigger: 'blur' }],
92
+ 'elementPoint.zn': [{ required: true, message: '请输入', trigger: 'blur' }]
93
+ },
94
+ title: '生成尾款发票',
95
+ open: false,
96
+ form: {}
97
+ }
98
+ },
99
+ computed: {},
100
+ watch: {},
101
+ methods: {
102
+ checkElement(element) {
103
+ return this.form?.elementPoint && this.form.elementPoint[element] != null
104
+ },
105
+ //转换元素
106
+ formatElement(form) {
107
+ var elementPoint = {}
108
+ form.contractDetailList.forEach((contractDetail) => {
109
+ const elementContent = contractDetail?.elementContent
110
+ if (elementContent) {
111
+ Object.keys(elementContent).forEach((key) => {
112
+ if (elementContent[key]) {
113
+ elementPoint[key] = elementPoint[key] || 8000
114
+ }
115
+ })
116
+ }
117
+ })
118
+ form.elementPoint = elementPoint
119
+ },
120
+ //是否有多元素商品
121
+ checkDetailListHaveElement(type) {
122
+ if (type == 'element') {
123
+ return this.form.contractDetailList?.filter((item) => this.checkElementItem(item?.elementContent)).length > 0
124
+ } else {
125
+ return this.form.contractDetailList?.filter((item) => !this.checkElementItem(item?.elementContent)).length > 0
126
+ }
127
+ },
128
+ //获取商品
129
+ getItemName(type) {
130
+ const items = this.form.contractDetailList?.filter((item) =>
131
+ type === 'element' ? this.checkElementItem(item?.elementContent) : !this.checkElementItem(item?.elementContent)
132
+ )
133
+
134
+ // 使用map将每个项目转换为<div>标签,然后用join合并为单个字符串
135
+ return items.map((item) => `<div>${item?.askName}</div>`).join('')
136
+ },
137
+ handleOpen(shipment) {
138
+ this.reset()
139
+ this.form = shipment
140
+ const contractDetailList = []
141
+ shipment.containerList.forEach((container) => {
142
+ container.containerDetailList.forEach((containerDetail) => {
143
+ contractDetailList.push(containerDetail.contractDetail)
144
+ })
145
+ })
146
+ this.form.contractDetailList = contractDetailList
147
+ this.formatElement(this.form)
148
+ this.open = true
149
+ },
150
+ submit() {
151
+ this.$refs['ruleForm'].validate((valid) => {
152
+ if (valid) {
153
+ const loading = this.openLoading()
154
+ updateWithContainerAndInvoice({ ...this.form, shipmentId: this.form.shipmentId, pointPrice: this.form.pointPrice, elementPoint: this.form.elementPoint })
155
+ .then((res) => {
156
+ if (res?.code !== 200) {
157
+ this.refresh && this.refresh()
158
+ this.open = false
159
+ loading.close()
160
+ return this.$message.error(res.message || '服务器异常')
161
+ }
162
+ getBalanceInvoice({ shipmentId: this.form.shipmentId }).then((res) => {
163
+ const invoice = res.data
164
+ this.refresh && this.refresh()
165
+ this.open = false
166
+ loading.close()
167
+ if (invoice) {
168
+ this.$router.push({
169
+ path: '/invoice/detail/' + invoice.id,
170
+ params: { id: invoice.id }
171
+ })
172
+ }
173
+ })
174
+ })
175
+ .finally(() => {
176
+ loading.close()
177
+ })
178
+ } else {
179
+ return false
180
+ }
181
+ })
182
+ },
183
+ cancel() {
184
+ this.reset()
185
+ this.open = false
186
+ },
187
+ reset() {
188
+ this.form = {
189
+ shipmentId: null,
190
+ pointPrice: null,
191
+ quoteType: null,
192
+ elementPoint: {
193
+ pb: null,
194
+ cu: null,
195
+ ni: null,
196
+ al: null,
197
+ co: null,
198
+ li: null,
199
+ zn: null,
200
+ sb: null,
201
+ bi: null,
202
+ sn: null,
203
+ ag: null,
204
+ au: null
205
+ }
206
+ }
207
+ }
208
+ },
209
+ created() {},
210
+ mounted() {},
211
+ beforeDestroy() {}
212
+ }
213
+ </script>
214
+ <style lang="scss" scoped></style>