sale-client 3.6.345 → 3.6.346
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/build/dev-server.js +1 -1
- package/package.json +1 -1
- package/src/filiale/hantou/ResSelect.vue +161 -0
- package/src/filiale/hantou/sale.js +2 -0
- package/src/main.js +1 -1
package/build/dev-server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var path = require('path')
|
|
2
2
|
var checkVersion = require('./versionCheck.js')
|
|
3
3
|
checkVersion()
|
|
4
|
-
const [ serverRul, localUrl, v4Url ] = ['http://
|
|
4
|
+
const [ serverRul, localUrl, v4Url ] = ['http://139.155.48.184:8401/', 'http://139.155.48.184:8401/', 'http://192.168.50.67:31785']
|
|
5
5
|
var merge = require('webpack-merge')
|
|
6
6
|
var baseConfig = require('./webpack.dev.conf')
|
|
7
7
|
var devConfig = {
|
package/package.json
CHANGED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-select :options='resoptions' placeholder='请选择'
|
|
3
|
+
:value.sync="selectres"
|
|
4
|
+
:multiple="isMul"
|
|
5
|
+
search="true"
|
|
6
|
+
:disabled="mustselect"
|
|
7
|
+
:close-on-select="!isMul"
|
|
8
|
+
@change="resChange"
|
|
9
|
+
>
|
|
10
|
+
</v-select>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import { HttpResetClass } from 'vue-client'
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
title: '资源选择',
|
|
18
|
+
props: {
|
|
19
|
+
restype: '', // 资源类型
|
|
20
|
+
resObj: {}, // 资源数据
|
|
21
|
+
isMul: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: true
|
|
24
|
+
},
|
|
25
|
+
initresid: {
|
|
26
|
+
type: Array,
|
|
27
|
+
default() { return [] },
|
|
28
|
+
},
|
|
29
|
+
parentresid: {
|
|
30
|
+
type: Array,
|
|
31
|
+
default() { return [] },
|
|
32
|
+
},
|
|
33
|
+
mustselect: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
data() {
|
|
39
|
+
return {
|
|
40
|
+
// 资源数据
|
|
41
|
+
resObj: {},
|
|
42
|
+
// 资源数据列表
|
|
43
|
+
resoptions: [],
|
|
44
|
+
// 选中资源数据
|
|
45
|
+
selectres: [],
|
|
46
|
+
// 记录已经添加过的父节点 ID
|
|
47
|
+
addedParentIds: new Set(),
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
ready() {
|
|
51
|
+
// 获取资源列表
|
|
52
|
+
this.getResList()
|
|
53
|
+
},
|
|
54
|
+
methods: {
|
|
55
|
+
// 遍历树形结构并转换为列表
|
|
56
|
+
findById(val) {
|
|
57
|
+
if (val) {
|
|
58
|
+
if (this.checkidres(val)) {
|
|
59
|
+
this.treetoList(val, '')
|
|
60
|
+
} else if (val.children.length > 0) {
|
|
61
|
+
for (let value of val.children) {
|
|
62
|
+
this.findById(value)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
// 树形结构转换为列表
|
|
68
|
+
treetoList(val, parentname) {
|
|
69
|
+
for (let value of val.children) {
|
|
70
|
+
this.ergodicList(value, parentname)
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
// 遍历节点列表
|
|
74
|
+
ergodicList(val, parentname) {
|
|
75
|
+
// Add parent node to options only if it hasn't been added before
|
|
76
|
+
if (parentname && !this.addedParentIds.has(val.parentid) && parentname != "组织机构") {
|
|
77
|
+
parentname = parentname.replace("组织机构", "")
|
|
78
|
+
this.resoptions.push({label: parentname, value: val.parentid})
|
|
79
|
+
this.addedParentIds.add(val.parentid) // Record that this parent has been added
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Process current node
|
|
83
|
+
if (val.children.length > 0) {
|
|
84
|
+
parentname = parentname + val.name
|
|
85
|
+
this.treetoList(val, parentname)
|
|
86
|
+
} else {
|
|
87
|
+
// Append organization-specific information
|
|
88
|
+
if (this.restype === 'organization') {
|
|
89
|
+
parentname = parentname.replace("组织机构", "")
|
|
90
|
+
this.resoptions.push({label: val.name + ' - ' + parentname, value: val.id})
|
|
91
|
+
} else {
|
|
92
|
+
this.resoptions.push({label: val.name, value: val.id})
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
// 检查 ID 是否存在
|
|
97
|
+
checkidres(val) {
|
|
98
|
+
let flag = false
|
|
99
|
+
if (this.parentresid.length === 0 && this.restype === 'organization') {
|
|
100
|
+
flag = true
|
|
101
|
+
}
|
|
102
|
+
this.parentresid.forEach((item) => {
|
|
103
|
+
if (item === val.id) {
|
|
104
|
+
flag = true
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
return flag;
|
|
108
|
+
},
|
|
109
|
+
// 资源改变
|
|
110
|
+
resChange(val) {
|
|
111
|
+
let orgnames = []
|
|
112
|
+
Object.keys(this.resoptions).forEach((key) => {
|
|
113
|
+
if (this.selectres.includes(this.resoptions[key].value))
|
|
114
|
+
orgnames.push(this.resoptions[key].label)
|
|
115
|
+
})
|
|
116
|
+
console.log('资源改变。。', val, orgnames)
|
|
117
|
+
this.$dispatch('res-select', this.selectres, orgnames)
|
|
118
|
+
},
|
|
119
|
+
// 获取资源数据
|
|
120
|
+
async getResList() {
|
|
121
|
+
let http = new HttpResetClass()
|
|
122
|
+
let req = await http.load('POST', '/rs/search', {
|
|
123
|
+
data: {
|
|
124
|
+
source: `tool.getFullTree(this.getRights().where(row.getType()==$${this.restype}$))`,
|
|
125
|
+
userid: this.$login.f.id
|
|
126
|
+
}
|
|
127
|
+
}, {resolveMsg: null, rejectMsg: '获取组织结构数据出错'})
|
|
128
|
+
this.resObj = req.data[0]
|
|
129
|
+
this.dealdata()
|
|
130
|
+
},
|
|
131
|
+
dealdata() {
|
|
132
|
+
this.resoptions = []
|
|
133
|
+
this.addedParentIds.clear() // Reset addedParentIds for each data deal
|
|
134
|
+
this.findById(this.resObj);
|
|
135
|
+
// 赋值资源数据
|
|
136
|
+
let arryselect = []
|
|
137
|
+
this.resoptions.forEach((item) => {
|
|
138
|
+
if (this.initresid.length > 0) {
|
|
139
|
+
this.initresid.forEach((init) => {
|
|
140
|
+
if (item.value == init) {
|
|
141
|
+
arryselect.push(item.value)
|
|
142
|
+
}
|
|
143
|
+
})
|
|
144
|
+
}
|
|
145
|
+
})
|
|
146
|
+
// 赋值资源选中初始值
|
|
147
|
+
this.selectres = arryselect
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
watch: {
|
|
151
|
+
// 监听初始化资源 id
|
|
152
|
+
'initresid.length'() {
|
|
153
|
+
this.dealdata()
|
|
154
|
+
},
|
|
155
|
+
// 监听父资源 id
|
|
156
|
+
'parentresid'() {
|
|
157
|
+
this.dealdata()
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
}
|
|
161
|
+
</script>
|
package/src/main.js
CHANGED
|
@@ -3,7 +3,7 @@ import all from 'vue-client/src/all'
|
|
|
3
3
|
import App from './App'
|
|
4
4
|
import system from 'system-clients/src/system'
|
|
5
5
|
import sale from './sale'
|
|
6
|
-
import FilialeSale from './filiale/
|
|
6
|
+
import FilialeSale from './filiale/hantou/sale'
|
|
7
7
|
import address from 'address-client/src/address'
|
|
8
8
|
import ldap from 'ldap-clients/src/ldap'
|
|
9
9
|
import VueClipboard from 'vue-clipboard2'
|