Browse Source

2023-10-13

master
guoxing 2 years ago
parent
commit
7c60bce47d
  1. 8
      supervise-crm-ui/src/utils/tree/index.js
  2. 485
      supervise-crm-ui/src/utils/tree/src/model/node.js
  3. 340
      supervise-crm-ui/src/utils/tree/src/model/tree-store.js
  4. 27
      supervise-crm-ui/src/utils/tree/src/model/util.js
  5. 279
      supervise-crm-ui/src/utils/tree/src/tree-node.vue
  6. 496
      supervise-crm-ui/src/utils/tree/src/tree.vue
  7. 14
      supervise-crm-ui/src/views/projectStaff/index.vue
  8. 2
      supervise-organizational-ui/.env.development
  9. 4
      supervise-report-ui/.env.development
  10. 10
      supervise-report-ui/src/api/supervise/salesreport.js
  11. 156
      supervise-report-ui/src/views/reportCenter/salesReport.vue
  12. 4
      supervise-uniapp/common/config.js
  13. 8
      supervise-uniapp/common/request.api.js
  14. 7
      supervise-uniapp/pages.json
  15. 2
      supervise-uniapp/pages/home/WorkFragment.vue
  16. 274
      supervise-uniapp/pages/index/DataAssembleList2.vue
  17. 193
      supervise-uniapp/pages/index/RegulatoryReporting.vue
  18. 9
      supervise-uniapp/pages/index/interestAccount.vue
  19. BIN
      supervise-uniapp/static/baseIcon/calendar.png
  20. BIN
      supervise-uniapp/static/baseIcon/project.png
  21. 27
      supervise-uniapp/utils/index.js
  22. 2
      yxt-portal-ui/src/views/Home/Home.vue

8
supervise-crm-ui/src/utils/tree/index.js

@ -0,0 +1,8 @@
import Tree from './src/tree.vue';
/* istanbul ignore next */
Tree.install = function(Vue) {
Vue.component(Tree.name, Tree);
};
export default Tree;

485
supervise-crm-ui/src/utils/tree/src/model/node.js

@ -0,0 +1,485 @@
import objectAssign from 'element-ui/src/utils/merge';
import { markNodeData, NODE_KEY } from './util';
import { arrayFindIndex } from 'element-ui/src/utils/util';
export const getChildState = node => {
let all = true;
let none = true;
let allWithoutDisable = true;
for (let i = 0, j = node.length; i < j; i++) {
const n = node[i];
if (n.checked !== true || n.indeterminate) {
all = false;
if (!n.disabled) {
allWithoutDisable = false;
}
}
if (n.checked !== false || n.indeterminate) {
none = false;
}
}
return { all, none, allWithoutDisable, half: !all && !none };
};
const reInitChecked = function(node) {
if (node.childNodes.length === 0) return;
const {all, none, half} = getChildState(node.childNodes);
if (all) {
node.checked = true;
node.indeterminate = false;
} else if (half) {
node.checked = false;
node.indeterminate = true;
} else if (none) {
node.checked = false;
node.indeterminate = false;
}
const parent = node.parent;
if (!parent || parent.level === 0) return;
if (!node.store.checkStrictly) {
reInitChecked(parent);
}
};
const getPropertyFromData = function(node, prop) {
const props = node.store.props;
const data = node.data || {};
const config = props[prop];
if (typeof config === 'function') {
return config(data, node);
} else if (typeof config === 'string') {
return data[config];
} else if (typeof config === 'undefined') {
const dataProp = data[prop];
return dataProp === undefined ? '' : dataProp;
}
};
let nodeIdSeed = 0;
export default class Node {
constructor(options) {
this.id = nodeIdSeed++;
this.text = null;
this.checked = false;
this.indeterminate = false;
this.data = null;
this.expanded = false;
this.parent = null;
this.visible = true;
this.isCurrent = false;
for (let name in options) {
if (options.hasOwnProperty(name)) {
this[name] = options[name];
}
}
// internal
this.level = 0;
this.loaded = false;
this.childNodes = [];
this.loading = false;
if (this.parent) {
this.level = this.parent.level + 1;
}
const store = this.store;
if (!store) {
throw new Error('[Node]store is required!');
}
store.registerNode(this);
const props = store.props;
if (props && typeof props.isLeaf !== 'undefined') {
const isLeaf = getPropertyFromData(this, 'isLeaf');
if (typeof isLeaf === 'boolean') {
this.isLeafByUser = isLeaf;
}
}
if (store.lazy !== true && this.data) {
this.setData(this.data);
if (store.defaultExpandAll) {
this.expanded = true;
}
} else if (this.level > 0 && store.lazy && store.defaultExpandAll) {
this.expand();
}
if (!Array.isArray(this.data)) {
markNodeData(this, this.data);
}
if (!this.data) return;
const defaultExpandedKeys = store.defaultExpandedKeys;
const key = store.key;
if (key && defaultExpandedKeys && defaultExpandedKeys.indexOf(this.key) !== -1) {
this.expand(null, store.autoExpandParent);
}
if (key && store.currentNodeKey !== undefined && this.key === store.currentNodeKey) {
store.currentNode = this;
store.currentNode.isCurrent = true;
}
if (store.lazy) {
store._initDefaultCheckedNode(this);
}
this.updateLeafState();
}
setData(data) {
if (!Array.isArray(data)) {
markNodeData(this, data);
}
this.data = data;
this.childNodes = [];
let children;
if (this.level === 0 && this.data instanceof Array) {
children = this.data;
} else {
children = getPropertyFromData(this, 'children') || [];
}
for (let i = 0, j = children.length; i < j; i++) {
this.insertChild({ data: children[i] });
}
}
get label() {
return getPropertyFromData(this, 'label');
}
get key() {
const nodeKey = this.store.key;
if (this.data) return this.data[nodeKey];
return null;
}
get disabled() {
return getPropertyFromData(this, 'disabled');
}
get nextSibling() {
const parent = this.parent;
if (parent) {
const index = parent.childNodes.indexOf(this);
if (index > -1) {
return parent.childNodes[index + 1];
}
}
return null;
}
get previousSibling() {
const parent = this.parent;
if (parent) {
const index = parent.childNodes.indexOf(this);
if (index > -1) {
return index > 0 ? parent.childNodes[index - 1] : null;
}
}
return null;
}
contains(target, deep = true) {
const walk = function(parent) {
const children = parent.childNodes || [];
let result = false;
for (let i = 0, j = children.length; i < j; i++) {
const child = children[i];
if (child === target || (deep && walk(child))) {
result = true;
break;
}
}
return result;
};
return walk(this);
}
remove() {
const parent = this.parent;
if (parent) {
parent.removeChild(this);
}
}
insertChild(child, index, batch) {
if (!child) throw new Error('insertChild error: child is required.');
if (!(child instanceof Node)) {
if (!batch) {
const children = this.getChildren(true);
if (children.indexOf(child.data) === -1) {
if (typeof index === 'undefined' || index < 0) {
children.push(child.data);
} else {
children.splice(index, 0, child.data);
}
}
}
objectAssign(child, {
parent: this,
store: this.store
});
child = new Node(child);
}
child.level = this.level + 1;
if (typeof index === 'undefined' || index < 0) {
this.childNodes.push(child);
} else {
this.childNodes.splice(index, 0, child);
}
this.updateLeafState();
}
insertBefore(child, ref) {
let index;
if (ref) {
index = this.childNodes.indexOf(ref);
}
this.insertChild(child, index);
}
insertAfter(child, ref) {
let index;
if (ref) {
index = this.childNodes.indexOf(ref);
if (index !== -1) index += 1;
}
this.insertChild(child, index);
}
removeChild(child) {
const children = this.getChildren() || [];
const dataIndex = children.indexOf(child.data);
if (dataIndex > -1) {
children.splice(dataIndex, 1);
}
const index = this.childNodes.indexOf(child);
if (index > -1) {
this.store && this.store.deregisterNode(child);
child.parent = null;
this.childNodes.splice(index, 1);
}
this.updateLeafState();
}
removeChildByData(data) {
let targetNode = null;
for (let i = 0; i < this.childNodes.length; i++) {
if (this.childNodes[i].data === data) {
targetNode = this.childNodes[i];
break;
}
}
if (targetNode) {
this.removeChild(targetNode);
}
}
expand(callback, expandParent) {
const done = () => {
if (expandParent) {
let parent = this.parent;
while (parent.level > 0) {
parent.expanded = true;
parent = parent.parent;
}
}
this.expanded = true;
if (callback) callback();
};
if (this.shouldLoadData()) {
this.loadData((data) => {
if (data instanceof Array) {
if (this.checked) {
this.setChecked(true, true);
} else if (!this.store.checkStrictly) {
reInitChecked(this);
}
done();
}
});
} else {
done();
}
}
doCreateChildren(array, defaultProps = {}) {
array.forEach((item) => {
this.insertChild(objectAssign({ data: item }, defaultProps), undefined, true);
});
}
collapse() {
this.expanded = false;
}
shouldLoadData() {
return this.store.lazy === true && this.store.load && !this.loaded;
}
updateLeafState() {
if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser !== 'undefined') {
this.isLeaf = this.isLeafByUser;
return;
}
const childNodes = this.childNodes;
if (!this.store.lazy || (this.store.lazy === true && this.loaded === true)) {
this.isLeaf = !childNodes || childNodes.length === 0;
return;
}
this.isLeaf = false;
}
setChecked(value, deep, recursion, passValue) {
this.indeterminate = value === 'half';
this.checked = value === true;
if (this.store.checkStrictly) return;
if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
let { all, allWithoutDisable } = getChildState(this.childNodes);
if (!this.isLeaf && (!all && allWithoutDisable)) {
this.checked = false;
value = false;
}
const handleDescendants = () => {
if (deep) {
const childNodes = this.childNodes;
for (let i = 0, j = childNodes.length; i < j; i++) {
const child = childNodes[i];
passValue = passValue || value !== false;
const isCheck = child.disabled ? child.checked : passValue;
child.setChecked(isCheck, deep, true, passValue);
}
const { half, all } = getChildState(childNodes);
if (!all) {
this.checked = all;
this.indeterminate = half;
}
}
};
if (this.shouldLoadData()) {
// Only work on lazy load data.
this.loadData(() => {
handleDescendants();
reInitChecked(this);
}, {
checked: value !== false
});
return;
} else {
handleDescendants();
}
}
const parent = this.parent;
if (!parent || parent.level === 0) return;
if (!recursion) {
reInitChecked(parent);
}
}
getChildren(forceInit = false) { // this is data
if (this.level === 0) return this.data;
const data = this.data;
if (!data) return null;
const props = this.store.props;
let children = 'children';
if (props) {
children = props.children || 'children';
}
if (data[children] === undefined) {
data[children] = null;
}
if (forceInit && !data[children]) {
data[children] = [];
}
return data[children];
}
updateChildren() {
const newData = this.getChildren() || [];
const oldData = this.childNodes.map((node) => node.data);
const newDataMap = {};
const newNodes = [];
newData.forEach((item, index) => {
const key = item[NODE_KEY];
const isNodeExists = !!key && arrayFindIndex(oldData, data => data[NODE_KEY] === key) >= 0;
if (isNodeExists) {
newDataMap[key] = { index, data: item };
} else {
newNodes.push({ index, data: item });
}
});
if (!this.store.lazy) {
oldData.forEach((item) => {
if (!newDataMap[item[NODE_KEY]]) this.removeChildByData(item);
});
}
newNodes.forEach(({ index, data }) => {
this.insertChild({ data }, index);
});
this.updateLeafState();
}
loadData(callback, defaultProps = {}) {
if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(defaultProps).length)) {
this.loading = true;
const resolve = (children) => {
this.loaded = true;
this.loading = false;
this.childNodes = [];
this.doCreateChildren(children, defaultProps);
this.updateLeafState();
if (callback) {
callback.call(this, children);
}
};
this.store.load(this, resolve);
} else {
if (callback) {
callback.call(this);
}
}
}
}

340
supervise-crm-ui/src/utils/tree/src/model/tree-store.js

@ -0,0 +1,340 @@
import Node from './node';
import { getNodeKey } from './util';
export default class TreeStore {
constructor(options) {
this.currentNode = null;
this.currentNodeKey = null;
for (let option in options) {
if (options.hasOwnProperty(option)) {
this[option] = options[option];
}
}
this.nodesMap = {};
this.root = new Node({
data: this.data,
store: this
});
if (this.lazy && this.load) {
const loadFn = this.load;
loadFn(this.root, (data) => {
this.root.doCreateChildren(data);
this._initDefaultCheckedNodes();
});
} else {
this._initDefaultCheckedNodes();
}
}
filter(value) {
const filterNodeMethod = this.filterNodeMethod;
const lazy = this.lazy;
const traverse = function(node) {
const childNodes = node.root ? node.root.childNodes : node.childNodes;
childNodes.forEach((child) => {
child.visible = filterNodeMethod.call(child, value, child.data, child);
traverse(child);
});
if (!node.visible && childNodes.length) {
let allHidden = true;
allHidden = !childNodes.some(child => child.visible);
if (node.root) {
node.root.visible = allHidden === false;
} else {
node.visible = allHidden === false;
}
}
if (!value) return;
if (node.visible && !node.isLeaf && !lazy) node.expand();
};
traverse(this);
}
setData(newVal) {
const instanceChanged = newVal !== this.root.data;
if (instanceChanged) {
this.root.setData(newVal);
this._initDefaultCheckedNodes();
} else {
this.root.updateChildren();
}
}
getNode(data) {
if (data instanceof Node) return data;
const key = typeof data !== 'object' ? data : getNodeKey(this.key, data);
return this.nodesMap[key] || null;
}
insertBefore(data, refData) {
const refNode = this.getNode(refData);
refNode.parent.insertBefore({ data }, refNode);
}
insertAfter(data, refData) {
const refNode = this.getNode(refData);
refNode.parent.insertAfter({ data }, refNode);
}
remove(data) {
const node = this.getNode(data);
if (node && node.parent) {
if (node === this.currentNode) {
this.currentNode = null;
}
node.parent.removeChild(node);
}
}
append(data, parentData) {
const parentNode = parentData ? this.getNode(parentData) : this.root;
if (parentNode) {
parentNode.insertChild({ data });
}
}
_initDefaultCheckedNodes() {
const defaultCheckedKeys = this.defaultCheckedKeys || [];
const nodesMap = this.nodesMap;
defaultCheckedKeys.forEach((checkedKey) => {
const node = nodesMap[checkedKey];
if (node) {
node.setChecked(true, !this.checkStrictly);
}
});
}
_initDefaultCheckedNode(node) {
const defaultCheckedKeys = this.defaultCheckedKeys || [];
if (defaultCheckedKeys.indexOf(node.key) !== -1) {
node.setChecked(true, !this.checkStrictly);
}
}
setDefaultCheckedKey(newVal) {
if (newVal !== this.defaultCheckedKeys) {
this.defaultCheckedKeys = newVal;
this._initDefaultCheckedNodes();
}
}
registerNode(node) {
const key = this.key;
if (!key || !node || !node.data) return;
const nodeKey = node.key;
if (nodeKey !== undefined) this.nodesMap[node.key] = node;
}
deregisterNode(node) {
const key = this.key;
if (!key || !node || !node.data) return;
node.childNodes.forEach(child => {
this.deregisterNode(child);
});
delete this.nodesMap[node.key];
}
getCheckedNodes(leafOnly = false, includeHalfChecked = false) {
const checkedNodes = [];
const traverse = function(node) {
const childNodes = node.root ? node.root.childNodes : node.childNodes;
childNodes.forEach((child) => {
if ((child.checked || (includeHalfChecked && child.indeterminate)) && (!leafOnly || (leafOnly && child.isLeaf))) {
checkedNodes.push(child.data);
}
traverse(child);
});
};
traverse(this);
return checkedNodes;
}
getCheckedKeys(leafOnly = false) {
return this.getCheckedNodes(leafOnly).map((data) => (data || {})[this.key]);
}
getHalfCheckedNodes() {
const nodes = [];
const traverse = function(node) {
const childNodes = node.root ? node.root.childNodes : node.childNodes;
childNodes.forEach((child) => {
if (child.indeterminate) {
nodes.push(child.data);
}
traverse(child);
});
};
traverse(this);
return nodes;
}
getHalfCheckedKeys() {
return this.getHalfCheckedNodes().map((data) => (data || {})[this.key]);
}
_getAllNodes() {
const allNodes = [];
const nodesMap = this.nodesMap;
for (let nodeKey in nodesMap) {
if (nodesMap.hasOwnProperty(nodeKey)) {
allNodes.push(nodesMap[nodeKey]);
}
}
return allNodes;
}
updateChildren(key, data) {
const node = this.nodesMap[key];
if (!node) return;
const childNodes = node.childNodes;
for (let i = childNodes.length - 1; i >= 0; i--) {
const child = childNodes[i];
this.remove(child.data);
}
for (let i = 0, j = data.length; i < j; i++) {
const child = data[i];
this.append(child, node.data);
}
}
_setCheckedKeys(key, leafOnly = false, checkedKeys) {
const allNodes = this._getAllNodes().sort((a, b) => b.level - a.level);
const cache = Object.create(null);
const keys = Object.keys(checkedKeys);
allNodes.forEach(node => node.setChecked(false, false));
for (let i = 0, j = allNodes.length; i < j; i++) {
const node = allNodes[i];
const nodeKey = node.data[key].toString();
let checked = keys.indexOf(nodeKey) > -1;
if (!checked) {
if (node.checked && !cache[nodeKey]) {
node.setChecked(false, false);
}
continue;
}
let parent = node.parent;
while (parent && parent.level > 0) {
cache[parent.data[key]] = true;
parent = parent.parent;
}
if (node.isLeaf || this.checkStrictly) {
node.setChecked(true, false);
continue;
}
node.setChecked(true, true);
if (leafOnly) {
node.setChecked(false, false);
const traverse = function(node) {
const childNodes = node.childNodes;
childNodes.forEach((child) => {
if (!child.isLeaf) {
child.setChecked(false, false);
}
traverse(child);
});
};
traverse(node);
}
}
}
setCheckedNodes(array, leafOnly = false) {
const key = this.key;
const checkedKeys = {};
array.forEach((item) => {
checkedKeys[(item || {})[key]] = true;
});
this._setCheckedKeys(key, leafOnly, checkedKeys);
}
setCheckedKeys(keys, leafOnly = false) {
this.defaultCheckedKeys = keys;
const key = this.key;
const checkedKeys = {};
keys.forEach((key) => {
checkedKeys[key] = true;
});
this._setCheckedKeys(key, leafOnly, checkedKeys);
}
setDefaultExpandedKeys(keys) {
keys = keys || [];
this.defaultExpandedKeys = keys;
keys.forEach((key) => {
const node = this.getNode(key);
if (node) node.expand(null, this.autoExpandParent);
});
}
setChecked(data, checked, deep) {
const node = this.getNode(data);
if (node) {
node.setChecked(!!checked, deep);
}
}
getCurrentNode() {
return this.currentNode;
}
setCurrentNode(currentNode) {
const prevCurrentNode = this.currentNode;
if (prevCurrentNode) {
prevCurrentNode.isCurrent = false;
}
this.currentNode = currentNode;
this.currentNode.isCurrent = true;
}
setUserCurrentNode(node) {
const key = node[this.key];
const currNode = this.nodesMap[key];
this.setCurrentNode(currNode);
}
setCurrentNodeKey(key) {
if (key === null || key === undefined) {
this.currentNode && (this.currentNode.isCurrent = false);
this.currentNode = null;
return;
}
const node = this.getNode(key);
if (node) {
this.setCurrentNode(node);
}
}
};

27
supervise-crm-ui/src/utils/tree/src/model/util.js

@ -0,0 +1,27 @@
export const NODE_KEY = '$treeNodeId';
export const markNodeData = function(node, data) {
if (!data || data[NODE_KEY]) return;
Object.defineProperty(data, NODE_KEY, {
value: node.id,
enumerable: false,
configurable: false,
writable: false
});
};
export const getNodeKey = function(key, data) {
if (!key) return data[NODE_KEY];
return data[key];
};
export const findNearestComponent = (element, componentName) => {
let target = element;
while (target && target.tagName !== 'BODY') {
if (target.__vue__ && target.__vue__.$options.name === componentName) {
return target.__vue__;
}
target = target.parentNode;
}
return null;
};

279
supervise-crm-ui/src/utils/tree/src/tree-node.vue

@ -0,0 +1,279 @@
<template>
<div
class="el-tree-node"
@click.stop="handleClick"
@contextmenu="($event) => this.handleContextMenu($event)"
v-show="node.visible"
:class="{
'is-expanded': expanded,
'is-current': node.isCurrent,
'is-hidden': !node.visible,
'is-focusable': !node.disabled,
'is-checked': !node.disabled && node.checked
}"
role="treeitem"
tabindex="-1"
:aria-expanded="expanded"
:aria-disabled="node.disabled"
:aria-checked="node.checked"
:draggable="tree.draggable"
@dragstart.stop="handleDragStart"
@dragover.stop="handleDragOver"
@dragend.stop="handleDragEnd"
@drop.stop="handleDrop"
ref="node"
>
<div class="el-tree-node__content"
:style="{ 'padding-left': (node.level - 1) * tree.indent + 'px' }">
<span
@click.stop="handleExpandIconClick"
:class="[
{ 'is-leaf': node.isLeaf, expanded: !node.isLeaf && expanded },
'el-tree-node__expand-icon',
tree.iconClass ? tree.iconClass : 'el-icon-caret-right'
]"
>
</span>
<el-checkbox
v-if="showCheckbox&&node.data.isOrg==='2'"
v-model="node.checked"
:indeterminate="node.indeterminate"
:disabled="!!node.disabled"
@click.native.stop
@change="handleCheckChange"
>
</el-checkbox>
<span
v-if="node.loading"
class="el-tree-node__loading-icon el-icon-loading">
</span>
<node-content :node="node"></node-content>
</div>
<el-collapse-transition>
<div
class="el-tree-node__children"
v-if="!renderAfterExpand || childNodeRendered"
v-show="expanded"
role="group"
:aria-expanded="expanded"
>
<el-tree-node
:render-content="renderContent"
v-for="child in node.childNodes"
:render-after-expand="renderAfterExpand"
:show-checkbox="showCheckbox"
:key="getNodeKey(child)"
:node="child"
@node-expand="handleChildNodeExpand">
</el-tree-node>
</div>
</el-collapse-transition>
</div>
</template>
<script type="text/jsx">
import ElCollapseTransition from 'element-ui/src/transitions/collapse-transition';
import ElCheckbox from 'element-ui/packages/checkbox';
import emitter from 'element-ui/src/mixins/emitter';
import { getNodeKey } from './model/util';
export default {
name: 'ElTreeNode',
componentName: 'ElTreeNode',
mixins: [emitter],
props: {
node: {
default() {
return {};
}
},
props: {},
renderContent: Function,
renderAfterExpand: {
type: Boolean,
default: true
},
showCheckbox: {
type: Boolean,
default: false
}
},
components: {
ElCollapseTransition,
ElCheckbox,
NodeContent: {
props: {
node: {
required: true
}
},
render(h) {
const parent = this.$parent;
const tree = parent.tree;
const node = this.node;
const { data, store } = node;
return (
parent.renderContent
? parent.renderContent.call(parent._renderProxy, h, { _self: tree.$vnode.context, node, data, store })
: tree.$scopedSlots.default
? tree.$scopedSlots.default({ node, data })
: <span class="el-tree-node__label">{ node.label }</span>
);
}
}
},
data() {
return {
tree: null,
expanded: false,
childNodeRendered: false,
oldChecked: null,
oldIndeterminate: null
};
},
watch: {
'node.indeterminate'(val) {
this.handleSelectChange(this.node.checked, val);
},
'node.checked'(val) {
this.handleSelectChange(val, this.node.indeterminate);
},
'node.expanded'(val) {
this.$nextTick(() => this.expanded = val);
if (val) {
this.childNodeRendered = true;
}
}
},
methods: {
getNodeKey(node) {
return getNodeKey(this.tree.nodeKey, node.data);
},
handleSelectChange(checked, indeterminate) {
if (this.oldChecked !== checked && this.oldIndeterminate !== indeterminate) {
this.tree.$emit('check-change', this.node.data, checked, indeterminate);
}
this.oldChecked = checked;
this.indeterminate = indeterminate;
},
handleClick() {
const store = this.tree.store;
store.setCurrentNode(this.node);
this.tree.$emit('current-change', store.currentNode ? store.currentNode.data : null, store.currentNode);
this.tree.currentNode = this;
if (this.tree.expandOnClickNode) {
this.handleExpandIconClick();
}
if (this.tree.checkOnClickNode && !this.node.disabled) {
this.handleCheckChange(null, {
target: { checked: !this.node.checked }
});
}
this.tree.$emit('node-click', this.node.data, this.node, this);
},
handleContextMenu(event) {
if (this.tree._events['node-contextmenu'] && this.tree._events['node-contextmenu'].length > 0) {
event.stopPropagation();
event.preventDefault();
}
this.tree.$emit('node-contextmenu', event, this.node.data, this.node, this);
},
handleExpandIconClick() {
if (this.node.isLeaf) return;
if (this.expanded) {
this.tree.$emit('node-collapse', this.node.data, this.node, this);
this.node.collapse();
} else {
this.node.expand();
this.$emit('node-expand', this.node.data, this.node, this);
}
},
handleCheckChange(value, ev) {
this.node.setChecked(ev.target.checked, !this.tree.checkStrictly);
this.$nextTick(() => {
const store = this.tree.store;
this.tree.$emit('check', this.node.data, {
checkedNodes: store.getCheckedNodes(),
checkedKeys: store.getCheckedKeys(),
halfCheckedNodes: store.getHalfCheckedNodes(),
halfCheckedKeys: store.getHalfCheckedKeys(),
});
});
},
handleChildNodeExpand(nodeData, node, instance) {
this.broadcast('ElTreeNode', 'tree-node-expand', node);
this.tree.$emit('node-expand', nodeData, node, instance);
},
handleDragStart(event) {
if (!this.tree.draggable) return;
this.tree.$emit('tree-node-drag-start', event, this);
},
handleDragOver(event) {
if (!this.tree.draggable) return;
this.tree.$emit('tree-node-drag-over', event, this);
event.preventDefault();
},
handleDrop(event) {
event.preventDefault();
},
handleDragEnd(event) {
if (!this.tree.draggable) return;
this.tree.$emit('tree-node-drag-end', event, this);
}
},
created() {
const parent = this.$parent;
if (parent.isTree) {
this.tree = parent;
} else {
this.tree = parent.tree;
}
const tree = this.tree;
if (!tree) {
console.warn('Can not find node\'s tree.');
}
const props = tree.props || {};
const childrenKey = props['children'] || 'children';
this.$watch(`node.data.${childrenKey}`, () => {
this.node.updateChildren();
});
if (this.node.expanded) {
this.expanded = true;
this.childNodeRendered = true;
}
if(this.tree.accordion) {
this.$on('tree-node-expand', node => {
if(this.node !== node) {
this.node.collapse();
}
});
}
}
};
</script>

496
supervise-crm-ui/src/utils/tree/src/tree.vue

@ -0,0 +1,496 @@
<template>
<div
class="el-tree"
:class="{
'el-tree--highlight-current': highlightCurrent,
'is-dragging': !!dragState.draggingNode,
'is-drop-not-allow': !dragState.allowDrop,
'is-drop-inner': dragState.dropType === 'inner'
}"
role="tree"
>
<el-tree-node
v-for="child in root.childNodes"
:node="child"
:props="props"
:render-after-expand="renderAfterExpand"
:show-checkbox="showCheckbox"
:key="getNodeKey(child)"
:render-content="renderContent"
@node-expand="handleNodeExpand">
</el-tree-node>
<div class="el-tree__empty-block" v-if="isEmpty">
<span class="el-tree__empty-text">{{ emptyText }}</span>
</div>
<div
v-show="dragState.showDropIndicator"
class="el-tree__drop-indicator"
ref="dropIndicator">
</div>
</div>
</template>
<script>
import TreeStore from './model/tree-store';
import { getNodeKey, findNearestComponent } from './model/util';
import ElTreeNode from './tree-node.vue';
import {t} from 'element-ui/src/locale';
import emitter from 'element-ui/src/mixins/emitter';
import { addClass, removeClass } from 'element-ui/src/utils/dom';
export default {
name: 'ElTree',
mixins: [emitter],
components: {
ElTreeNode
},
data() {
return {
store: null,
root: null,
currentNode: null,
treeItems: null,
checkboxItems: [],
dragState: {
showDropIndicator: false,
draggingNode: null,
dropNode: null,
allowDrop: true
}
};
},
props: {
data: {
type: Array
},
emptyText: {
type: String,
default() {
return t('el.tree.emptyText');
}
},
renderAfterExpand: {
type: Boolean,
default: true
},
nodeKey: String,
checkStrictly: Boolean,
defaultExpandAll: Boolean,
expandOnClickNode: {
type: Boolean,
default: true
},
checkOnClickNode: Boolean,
checkDescendants: {
type: Boolean,
default: false
},
autoExpandParent: {
type: Boolean,
default: true
},
defaultCheckedKeys: Array,
defaultExpandedKeys: Array,
currentNodeKey: [String, Number],
renderContent: Function,
showCheckbox: {
type: Boolean,
default: false
},
draggable: {
type: Boolean,
default: false
},
allowDrag: Function,
allowDrop: Function,
props: {
default() {
return {
children: 'children',
label: 'label',
disabled: 'disabled'
};
}
},
lazy: {
type: Boolean,
default: false
},
highlightCurrent: Boolean,
load: Function,
filterNodeMethod: Function,
accordion: Boolean,
indent: {
type: Number,
default: 18
},
iconClass: String
},
computed: {
children: {
set(value) {
this.data = value;
},
get() {
return this.data;
}
},
treeItemArray() {
return Array.prototype.slice.call(this.treeItems);
},
isEmpty() {
const { childNodes } = this.root;
return !childNodes || childNodes.length === 0 || childNodes.every(({visible}) => !visible);
}
},
watch: {
defaultCheckedKeys(newVal) {
this.store.setDefaultCheckedKey(newVal);
},
defaultExpandedKeys(newVal) {
this.store.defaultExpandedKeys = newVal;
this.store.setDefaultExpandedKeys(newVal);
},
data(newVal) {
this.store.setData(newVal);
},
checkboxItems(val) {
Array.prototype.forEach.call(val, (checkbox) => {
checkbox.setAttribute('tabindex', -1);
});
},
checkStrictly(newVal) {
this.store.checkStrictly = newVal;
}
},
methods: {
filter(value) {
if (!this.filterNodeMethod) throw new Error('[Tree] filterNodeMethod is required when filter');
this.store.filter(value);
},
getNodeKey(node) {
return getNodeKey(this.nodeKey, node.data);
},
getNodePath(data) {
if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in getNodePath');
const node = this.store.getNode(data);
if (!node) return [];
const path = [node.data];
let parent = node.parent;
while (parent && parent !== this.root) {
path.push(parent.data);
parent = parent.parent;
}
return path.reverse();
},
getCheckedNodes(leafOnly, includeHalfChecked) {
return this.store.getCheckedNodes(leafOnly, includeHalfChecked);
},
getCheckedKeys(leafOnly) {
return this.store.getCheckedKeys(leafOnly);
},
getCurrentNode() {
const currentNode = this.store.getCurrentNode();
return currentNode ? currentNode.data : null;
},
getCurrentKey() {
if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in getCurrentKey');
const currentNode = this.getCurrentNode();
return currentNode ? currentNode[this.nodeKey] : null;
},
setCheckedNodes(nodes, leafOnly) {
if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCheckedNodes');
this.store.setCheckedNodes(nodes, leafOnly);
},
setCheckedKeys(keys, leafOnly) {
if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCheckedKeys');
this.store.setCheckedKeys(keys, leafOnly);
},
setChecked(data, checked, deep) {
this.store.setChecked(data, checked, deep);
},
getHalfCheckedNodes() {
return this.store.getHalfCheckedNodes();
},
getHalfCheckedKeys() {
return this.store.getHalfCheckedKeys();
},
setCurrentNode(node) {
if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCurrentNode');
this.store.setUserCurrentNode(node);
},
setCurrentKey(key) {
if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCurrentKey');
this.store.setCurrentNodeKey(key);
},
getNode(data) {
return this.store.getNode(data);
},
remove(data) {
this.store.remove(data);
},
append(data, parentNode) {
this.store.append(data, parentNode);
},
insertBefore(data, refNode) {
this.store.insertBefore(data, refNode);
},
insertAfter(data, refNode) {
this.store.insertAfter(data, refNode);
},
handleNodeExpand(nodeData, node, instance) {
this.broadcast('ElTreeNode', 'tree-node-expand', node);
this.$emit('node-expand', nodeData, node, instance);
},
updateKeyChildren(key, data) {
if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in updateKeyChild');
this.store.updateChildren(key, data);
},
initTabIndex() {
this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]');
this.checkboxItems = this.$el.querySelectorAll('input[type=checkbox]');
const checkedItem = this.$el.querySelectorAll('.is-checked[role=treeitem]');
if (checkedItem.length) {
checkedItem[0].setAttribute('tabindex', 0);
return;
}
this.treeItems[0] && this.treeItems[0].setAttribute('tabindex', 0);
},
handleKeydown(ev) {
const currentItem = ev.target;
if (currentItem.className.indexOf('el-tree-node') === -1) return;
const keyCode = ev.keyCode;
this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]');
const currentIndex = this.treeItemArray.indexOf(currentItem);
let nextIndex;
if ([38, 40].indexOf(keyCode) > -1) { // updown
ev.preventDefault();
if (keyCode === 38) { // up
nextIndex = currentIndex !== 0 ? currentIndex - 1 : 0;
} else {
nextIndex = (currentIndex < this.treeItemArray.length - 1) ? currentIndex + 1 : 0;
}
this.treeItemArray[nextIndex].focus(); //
}
if ([37, 39].indexOf(keyCode) > -1) { // leftright
ev.preventDefault();
currentItem.click(); //
}
const hasInput = currentItem.querySelector('[type="checkbox"]');
if ([13, 32].indexOf(keyCode) > -1 && hasInput) { // space entercheckbox
ev.preventDefault();
hasInput.click();
}
}
},
created() {
this.isTree = true;
this.store = new TreeStore({
key: this.nodeKey,
data: this.data,
lazy: this.lazy,
props: this.props,
load: this.load,
currentNodeKey: this.currentNodeKey,
checkStrictly: this.checkStrictly,
checkDescendants: this.checkDescendants,
defaultCheckedKeys: this.defaultCheckedKeys,
defaultExpandedKeys: this.defaultExpandedKeys,
autoExpandParent: this.autoExpandParent,
defaultExpandAll: this.defaultExpandAll,
filterNodeMethod: this.filterNodeMethod
});
this.root = this.store.root;
let dragState = this.dragState;
this.$on('tree-node-drag-start', (event, treeNode) => {
if (typeof this.allowDrag === 'function' && !this.allowDrag(treeNode.node)) {
event.preventDefault();
return false;
}
event.dataTransfer.effectAllowed = 'move';
// wrap in try catch to address IE's error when first param is 'text/plain'
try {
// setData is required for draggable to work in FireFox
// the content has to be '' so dragging a node out of the tree won't open a new tab in FireFox
event.dataTransfer.setData('text/plain', '');
} catch (e) {}
dragState.draggingNode = treeNode;
this.$emit('node-drag-start', treeNode.node, event);
});
this.$on('tree-node-drag-over', (event, treeNode) => {
const dropNode = findNearestComponent(event.target, 'ElTreeNode');
const oldDropNode = dragState.dropNode;
if (oldDropNode && oldDropNode !== dropNode) {
removeClass(oldDropNode.$el, 'is-drop-inner');
}
const draggingNode = dragState.draggingNode;
if (!draggingNode || !dropNode) return;
let dropPrev = true;
let dropInner = true;
let dropNext = true;
let userAllowDropInner = true;
if (typeof this.allowDrop === 'function') {
dropPrev = this.allowDrop(draggingNode.node, dropNode.node, 'prev');
userAllowDropInner = dropInner = this.allowDrop(draggingNode.node, dropNode.node, 'inner');
dropNext = this.allowDrop(draggingNode.node, dropNode.node, 'next');
}
event.dataTransfer.dropEffect = dropInner ? 'move' : 'none';
if ((dropPrev || dropInner || dropNext) && oldDropNode !== dropNode) {
if (oldDropNode) {
this.$emit('node-drag-leave', draggingNode.node, oldDropNode.node, event);
}
this.$emit('node-drag-enter', draggingNode.node, dropNode.node, event);
}
if (dropPrev || dropInner || dropNext) {
dragState.dropNode = dropNode;
}
if (dropNode.node.nextSibling === draggingNode.node) {
dropNext = false;
}
if (dropNode.node.previousSibling === draggingNode.node) {
dropPrev = false;
}
if (dropNode.node.contains(draggingNode.node, false)) {
dropInner = false;
}
if (draggingNode.node === dropNode.node || draggingNode.node.contains(dropNode.node)) {
dropPrev = false;
dropInner = false;
dropNext = false;
}
const targetPosition = dropNode.$el.getBoundingClientRect();
const treePosition = this.$el.getBoundingClientRect();
let dropType;
const prevPercent = dropPrev ? (dropInner ? 0.25 : (dropNext ? 0.45 : 1)) : -1;
const nextPercent = dropNext ? (dropInner ? 0.75 : (dropPrev ? 0.55 : 0)) : 1;
let indicatorTop = -9999;
const distance = event.clientY - targetPosition.top;
if (distance < targetPosition.height * prevPercent) {
dropType = 'before';
} else if (distance > targetPosition.height * nextPercent) {
dropType = 'after';
} else if (dropInner) {
dropType = 'inner';
} else {
dropType = 'none';
}
const iconPosition = dropNode.$el.querySelector('.el-tree-node__expand-icon').getBoundingClientRect();
const dropIndicator = this.$refs.dropIndicator;
if (dropType === 'before') {
indicatorTop = iconPosition.top - treePosition.top;
} else if (dropType === 'after') {
indicatorTop = iconPosition.bottom - treePosition.top;
}
dropIndicator.style.top = indicatorTop + 'px';
dropIndicator.style.left = (iconPosition.right - treePosition.left) + 'px';
if (dropType === 'inner') {
addClass(dropNode.$el, 'is-drop-inner');
} else {
removeClass(dropNode.$el, 'is-drop-inner');
}
dragState.showDropIndicator = dropType === 'before' || dropType === 'after';
dragState.allowDrop = dragState.showDropIndicator || userAllowDropInner;
dragState.dropType = dropType;
this.$emit('node-drag-over', draggingNode.node, dropNode.node, event);
});
this.$on('tree-node-drag-end', (event) => {
const { draggingNode, dropType, dropNode } = dragState;
event.preventDefault();
event.dataTransfer.dropEffect = 'move';
if (draggingNode && dropNode) {
const draggingNodeCopy = { data: draggingNode.node.data };
if (dropType !== 'none') {
draggingNode.node.remove();
}
if (dropType === 'before') {
dropNode.node.parent.insertBefore(draggingNodeCopy, dropNode.node);
} else if (dropType === 'after') {
dropNode.node.parent.insertAfter(draggingNodeCopy, dropNode.node);
} else if (dropType === 'inner') {
dropNode.node.insertChild(draggingNodeCopy);
}
if (dropType !== 'none') {
this.store.registerNode(draggingNodeCopy);
}
removeClass(dropNode.$el, 'is-drop-inner');
this.$emit('node-drag-end', draggingNode.node, dropNode.node, dropType, event);
if (dropType !== 'none') {
this.$emit('node-drop', draggingNode.node, dropNode.node, dropType, event);
}
}
if (draggingNode && !dropNode) {
this.$emit('node-drag-end', draggingNode.node, null, dropType, event);
}
dragState.showDropIndicator = false;
dragState.draggingNode = null;
dragState.dropNode = null;
dragState.allowDrop = true;
});
},
mounted() {
this.initTabIndex();
this.$el.addEventListener('keydown', this.handleKeydown);
},
updated() {
this.treeItems = this.$el.querySelectorAll('[role=treeitem]');
this.checkboxItems = this.$el.querySelectorAll('input[type=checkbox]');
}
};
</script>

14
supervise-crm-ui/src/views/projectStaff/index.vue

@ -49,18 +49,19 @@
<button class="relevance" @click="getRelevance">关联</button>
</div>
<div class="org-tree">
<el-tree :data="sysorganList2" show-checkbox node-key="sid" :props="props" ref="tree2" highlight-current
<eltree :data="sysorganList2" show-checkbox node-key="sid" :props="props" ref="tree2" highlight-current
check-strictly :default-checked-keys="uploadData.users"
:default-expanded-keys="['2','fd6435f2-0005-11ec-a033-48452053aa33','3042d730-64e8-4e34-b08a-44adca4da3a5']"
@check="handleNodeClick2">
<div class="custom-tree-node" slot-scope="{ node, data }"
style=" width: 100%;display: flex;flex-direction: row; align-items: center;flex-shrink: 1;">
style=" width: 100%;display: flex;flex-direction: row; align-items: center;flex-shrink: 1;"
:class="{'checkbox':data.isOrg==='1'}">
<div :class="{ 'title': data.psid==='0' }">{{ node.label }}</div>
</div>
</el-tree>
</eltree>
</div>
</div>
</div>
@ -75,6 +76,7 @@
</template>
<script>
import eltree from '../../utils/tree/src/tree.vue'
import req from '@/api/projectStaff/index'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
@ -82,6 +84,7 @@
export default {
name: 'SupplierBankInfoIndex',
components: {
eltree,
ButtonBar,
Pagination,
pageye
@ -353,6 +356,11 @@
border: 1px solid #edf1f7;
overflow: scroll;
overflow-x: hidden;
.checkbox .is-leaf + .el-checkbox .el-checkbox__inner {
display: none;
}
}
.listtop {

2
supervise-organizational-ui/.env.development

@ -5,5 +5,5 @@ ENV = 'development'
VUE_APP_BASE_API = '/api'
## 配置测试和本地开发时的 接口地址
VUE_APP_URL = "http://192.168.1.193:8112"
VUE_APP_URL = "http://192.168.1.107:8112"
##VUE_APP_URL = "http://8.130.39.13:8112"

4
supervise-report-ui/.env.development

@ -5,5 +5,5 @@ ENV = 'development'
VUE_APP_BASE_API = '/api/service'
## 配置测试和本地开发时的 接口地址
VUE_APP_URL = "http://8.130.39.13:8112"
##VUE_APP_URL = "http://192.168.1.193:8112"
##VUE_APP_URL = "http://8.130.39.13:8112"
VUE_APP_URL = "http://192.168.1.193:8112"

10
supervise-report-ui/src/api/supervise/salesreport.js

@ -13,4 +13,14 @@ export default {
})
},
initData(data) {
return request({
baseURL: '/api',
url: '/report/DailySalesReport/getSalesByDate/'+data,
method: 'get',
})
},
}

156
supervise-report-ui/src/views/reportCenter/salesReport.vue

@ -13,13 +13,13 @@
<el-date-picker v-model="queryParams.date" type="date" clearable value-format="yyyy-MM-dd"
placeholder="选择日期" />
</el-form-item>
<el-form-item label="类别">
<!-- <el-form-item label="类别">
<el-select v-model="queryParams.type" filterable placeholder="全部" clearable>
<el-option v-for="item in state_list" :key="item.dictKey" :label="item.dictValue"
:value="item.dictKey">
</el-option>
</el-select>
</el-form-item>
</el-form-item> -->
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
@ -30,19 +30,28 @@
<div>
<el-form>
<el-row>
<el-col :span="8">
<el-col :span="24">
<div class="listtop" style="border: 0;">
<div class="tit">当日数据 {{nowDate}}</div>
</div>
<div id="main" style="width: 100%;height: 100%;min-height: 480px; margin-top: 30px;"></div>
</el-col>
</el-row>
<el-row >
<el-col :span="12">
<div>
<div style="margin-left: 20px;margin-right: 30px;">
<el-table v-loading="tableLoading" :key="tableKey" :data="dataList" border style="width: 100%"
show-summary :summary-method="getSummaries">
<el-table-column prop="name" label="现金流量-经营活动产生的现金流量(元)" align="center" />
<el-table-column prop="totalPrice" label="总额" align="center" width="150" />
</el-table>
</div>
<div style="margin-top: 50px;">
</el-col>
<el-col :span="12">
<div style="margin-left: 30px;margin-right: 20px;">
<el-table v-loading="tableLoading" :data="listSalesChannelData" border style="width: 100%">
<el-table-column width="200" label="销售渠道类别" prop="salesChannelCategory" align="center" />
<el-table-column label="总额" prop="totalAmount" align="center" />
@ -50,19 +59,17 @@
<el-table-column label="扣除应收" prop="deductionAccountsReceivable" align="center" />
</el-table>
</div>
</el-col>
<el-col :span="16">
<!-- <div style="margin-left: 50px;margin-top: 20px;"> -->
<div id="main" style="width: 100%;height: 100%;min-height: 480px; margin-top: 30px;"></div>
<!-- <div id="main" style="width: 100%;height: 100%;min-height: 480px; margin-top: 30px;"></div> -->
<!-- </div> -->
</el-col>
</el-row>
</el-form>
</div>
<div style="display: flex; flex-direction: row;margin-top: 20px;width: 100%;">
<!-- <div style="width: 35%;">
<!-- <div style="display: flex; flex-direction: row;margin-top: 20px;width: 100%;">
<div style="width: 35%;">
<div class="tit">当日数据 {{nowDate}}</div>
<div style="margin-top: 30px;">
<el-table v-loading="tableLoading" :key="tableKey" :data="dataList" border style="width: 100%"
@ -79,12 +86,12 @@
<el-table-column label="扣除应收" prop="deductionAccountsReceivable" align="center" />
</el-table>
</div>
</div> -->
</div>
<div style="width: 65%;margin-left: 50px;margin-top: 20px;">
<div id="main" style="width: 800px; height: 500px;margin-top: 30px;"></div>
</div>
</div>
</div> -->
</div>
</div>
</div>
@ -113,39 +120,41 @@
searchxianshitit: '显示查询条件',
tableLoading: false,
tableKey: 0,
dataList: [{
name: '销售商品收到的现金(元)',
totalPrice: '10000'
},
{
name: '收到其他与经营活动有关的现金(元)',
totalPrice: '2000'
}
dataList: [
// {
// name: '()',
// totalPrice: '10000'
// },
// {
// name: '()',
// totalPrice: '2000'
// }
],
listSalesChannelData: [{
salesChannelCategory: '连网连锁店',
totalAmount: '2000000',
accountsReceivable: '31,914',
deductionAccountsReceivable: '35,793'
},
{
salesChannelCategory: '连锁内加盟',
totalAmount: '28,700',
accountsReceivable: '28,749',
deductionAccountsReceivable: '58,339'
},
{
salesChannelCategory: '配送中心',
totalAmount: '-1241.81',
accountsReceivable: '28,749',
deductionAccountsReceivable: '58,339'
},
{
salesChannelCategory: '连锁外加盟',
totalAmount: '29822.44',
accountsReceivable: '28,749',
deductionAccountsReceivable: '58,339'
}
listSalesChannelData: [
// {
// salesChannelCategory: '',
// totalAmount: '2000000',
// accountsReceivable: '31,914',
// deductionAccountsReceivable: '35,793'
// },
// {
// salesChannelCategory: '',
// totalAmount: '28,700',
// accountsReceivable: '28,749',
// deductionAccountsReceivable: '58,339'
// },
// {
// salesChannelCategory: '',
// totalAmount: '-1241.81',
// accountsReceivable: '28,749',
// deductionAccountsReceivable: '58,339'
// },
// {
// salesChannelCategory: '',
// totalAmount: '29822.44',
// accountsReceivable: '28,749',
// deductionAccountsReceivable: '58,339'
// }
],
financialAnalysisChartData: {},
// 1.,2.3.
@ -178,9 +187,9 @@
}
],
queryParams: {
customerSid: '11',
date: "",
type: "" // key
// customerSid: '11',
date: "2023-9-5",
// type: "" // key
},
nowDate: this.getDate(),
@ -191,14 +200,14 @@
dataset: {
//
source: [
['product', '分销商进货额', '实际发货额'],
['1-1', "30816", '28700'],
['1-2', '20960', '15471'],
['1-3', 31465, 41573],
['1-4', 32796, 26290],
['1-5', 31914, 28749],
['1-6', 35793, 58339],
['1-7', 33370, 16888]
// ['product', '', ''],
// ['1-1', "30816", '28700'],
// ['1-2', '20960', '15471'],
// ['1-3', 31465, 41573],
// ['1-4', 32796, 26290],
// ['1-5', 31914, 28749],
// ['1-6', 35793, 58339],
// ['1-7', 33370, 16888]
]
},
// X category dataset
@ -258,7 +267,7 @@
this.tableLoading = true
let _this = this
req.initData(_this.queryParams).then((resp) => {
req.initData(_this.queryParams.date).then((resp) => {
if (resp.success) {
console.log('1111', resp.data)
const data = resp.data
@ -285,6 +294,29 @@
myChart.setOption({
legend: {},
tooltip: {},
// toolbox: {
// feature: {
// dataView: {
// //
// show: true,
// readOnly: true
// },
// magicType: {
// //
// show: false,
// // type: ['line', 'bar']
// },
// //
// restore: {
// show: true
// },
// //
// saveAsImage: {
// show: true
// }
// }
// },
dataset: {
//
source: obj
@ -300,6 +332,14 @@
type: 'bar'
}, {
type: 'bar'
},{
type: 'bar'
}, {
type: 'bar'
},{
type: 'bar'
},{
type: 'bar'
}]
})
},
@ -312,9 +352,7 @@
},
resetQuery() {
this.queryParams = {
customerSid: '',
date: "",
type: '' // key
date:this.getDate(),
}
this.loadList();

4
supervise-uniapp/common/config.js

@ -7,8 +7,8 @@
*/
module.exports = {
// baseUrl: 'https://jianguan.yyundong.com/api',
// baseUrl: 'https://supervise.yxtsoft.com',
baseUrl: 'http://192.168.1.107:8112',
baseUrl: 'https://supervise.yxtsoft.com',
// baseUrl: 'http://192.168.1.107:8112',
// baseUrl: 'http://192.168.1.110:8112',
tokenName: "Authorization", // 请求头中token的名字,与服务器端对应
loginTimeoutCode: "5001", // 登录超时或失效的情况下,服务器端返回的错误码

8
supervise-uniapp/common/request.api.js

@ -83,7 +83,7 @@ export default {
// 获取首页面数据
getWorkData: (params = {}) => request.get("/report/messagepushlog/numberOfJobs/" + params, params),
getWorkData: (params = {}) => request.get("/reportwxmpapi/messagepushlog/numberOfJobs/" + params, params),
// 获取消息类型列表
messageTypeList: (params = {}) => request.post("/reportwxmpapi/MessageType/list ", params),
@ -130,7 +130,7 @@ export default {
storeHouseDetail: (params = {}) => request.get("/api/portal/v1/flow/fetchDetailsBySid/" + params, params),
// 获取我的项目
getProjectByUserSid: (params = {}) => request.get("/crm/v1/projectinformation/getProjectByUserSid/" + params,
getProjectByUserSid: (params = {}) => request.get("/api/crm/v1/projectinformation/getProjectByUserSid/" + params,
params),
// 获取我的项目详情
@ -147,8 +147,8 @@ export default {
// 获取数据总览列表
projectListPage: (params = {}) => request.post("/reportwxmpapi/projectdaily/selectListPage", params),
// 获取数据总览列表
projectListPageNew: (params = {}) => request.post("/reportwxmpapi/projectdaily/selectList", params),

7
supervise-uniapp/pages.json

@ -136,7 +136,14 @@
}
},
{
"path": "pages/index/DataAssembleList2",
"style": {
"navigationBarTitleText": "数据总览",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/InventoryInfoDetail",

2
supervise-uniapp/pages/home/WorkFragment.vue

@ -482,7 +482,7 @@
// duration: 2000,
// });
uni.navigateTo({
url: '../index/DataAssembleList'
url: '../index/DataAssembleList2'
});
break;

274
supervise-uniapp/pages/index/DataAssembleList2.vue

@ -0,0 +1,274 @@
<template>
<view class="page">
<view class="top">
<text class="top-title">全部项目</text>
<view class="top-num">
<image class="top-num-img" src="../../static/baseIcon/project.png"></image>
<text class="top-num-text">{{dataList.length}}</text>
</view>
<view class="top-date" @click="openDate">
<text class="top-date-text">{{params.orderDate}}</text>
<image class="top-date-img" src="../../static/baseIcon/calendar.png"></image>
</view>
</view>
<view class="money">
<text class="money-text">总授信{{allCredit}}</text>
<text class="money-text">总用信{{allUseCredit}}</text>
</view>
<view class="list">
<view v-for="(item,index) in dataList" class="newslist" @click="itemClick(item)">
<view class="item" :class="{'item2':index==dataList.length-1}">
<view class="item-name">{{item.projectName}}</view>
<view>
<text class="item-num" :class="{'item-num2':item.state=='2'}">{{item.pledgeRatePercent}}%</text>
<text class="item-num">/ {{item.bankPledgeRate}}%</text>
</view>
<image src="../../static/baseIcon/zy.png" style="width: 15px;height: 15px;" mode="aspectFill">
</image>
</view>
</view>
</view>
<u-datetime-picker ref="datetimePicker" :closeOnClickOverlay='true' @close="cancelClick" @cancel="cancelClick"
@confirm="confirmClick" :show="datetimeShow" v-model="orderDate" mode="date" :formatter="formatter">
</u-datetime-picker>
</view>
</template>
<script>
import {
formatTimeTwo,
beforeDay
} from "@/utils/index";
export default {
data() {
return {
datetimeShow: false,
allCredit: "",
allUseCredit: "",
orderDate:"",
params: {
userSid: getApp().globalData.sid ,
orderDate: "",
},
dataList: [
],
};
},
onLoad() {
this.params.orderDate = beforeDay(null,-1)
},
onShow() {
this.loadData();
},
onReady() {
/* #ifdef MP-WEIXIN */
//
this.$refs.datetimePicker.setFormatter(this.formatter)
/* #endif */
},
methods: {
openDate() {
console.log('openDate')
this.datetimeShow = true
},
formatter(type, value) {
if (type === 'year') {
return `${value}`
}
if (type === 'month') {
return `${value}`
}
if (type === 'day') {
return `${value}`
}
return value
},
cancelClick() {
this.datetimeShow = false
},
confirmClick(date) {
console.log('confirmClick', date)
console.log('confirmClick', formatTimeTwo(parseInt(date.value), "Y-M-D"))
this.params.orderDate = formatTimeTwo(parseInt(date.value), "Y-M-D")
this.datetimeShow = false
this.loadData()
},
loadData() {
console.log('params', this.params)
this.$api.projectListPageNew(this.params).then((resp) => {
// if (resp.success) {
console.log('1111', resp)
this.allCredit=resp.creditLimitTotal
this.allUseCredit=resp.useLimitTotal
this.dataList = resp.list
}).catch(e => {
console.log('eeeee', e)
})
},
itemClick(item) {
console.log('itemClick', item)
console.log('orderDate', this.params.orderDate)
uni.navigateTo({
url: '../index/RegulatoryReporting?projectSid=' + item.projectSid + "&orderDate=" + this.params.orderDate
});
}
}
}
</script>
<style lang="scss">
.page {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
.top {
margin-top: 5px;
padding: 20px;
background: #fff;
display: flex;
flex-direction: row;
align-items: center;
.top-title {
color: #000;
font-size: 18px;
font-family: sans-serif;
font-weight: 600;
}
.top-num {
margin-left: 20px;
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
.top-num-img {
width: 14px;
height: 14px;
}
.top-num-text {
margin-left: 5px;
color: #E99D42;
font-size: 14px;
}
}
.top-date {
display: flex;
flex-direction: row;
align-items: center;
.top-date-text {
color: #717171 100%;
font-size: 14px;
margin-right: 10px;
}
.top-date-img {
width: 14px;
height: 14px;
}
}
}
.money {
display: flex;
flex-direction: row;
align-items: center;
border-top: 1px solid #eee;
padding: 10px 0px;
background: #fff;
.money-text {
margin-left: 20px;
font-size: 15px;
color: #191919;
}
}
.list {
margin-top: 10px;
background: #fff;
.newslist {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
.item {
width: 100%;
padding: 20px 20px;
display: flex;
flex-direction: row;
align-items: center;
border-bottom: 1px #eee solid;
.item-name {
flex: 1;
color: #191919;
font-size: 15px;
font-weight: 600;
font-family: sans-serif;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
margin-right: 20px;
}
.item-num {
margin-right: 5px;
color: #999999;
font-size: 12px;
}
.item-num2 {
color: #FF5006;
}
}
.item2 {
border-bottom: none;
}
}
}
}
</style>

193
supervise-uniapp/pages/index/RegulatoryReporting.vue

@ -4,7 +4,22 @@
<view class="top">
<text class="top-name">{{info.projectName}}</text>
<view style="display: flex;flex-direction: row;align-items: center;" @click="openDate">
<text class="top-date">{{info.orderDate}}</text>
<image style=" width: 14px;
height: 14px; margin-left: 10px;" src="../../static/baseIcon/calendar.png"></image>
</view>
</view>
<view v-if="show">
<view class="download">
<view style="flex: 1;"></view>
<view class="download-lift-view" @click="jump">
<image src="../../static/baseIcon/download.png" style="width: 16px;height: 16px;" mode="aspectFill">
</image>
<text class="download-lift-view-text">报表下载</text>
</view>
</view>
<view class="centre">
@ -15,12 +30,9 @@
<view class="centre-bom">
<text class="centre-lift-text">贷款总额{{info.totalLoanWan==''?'--':info.totalLoanWan}}万元</text>
<view class="centre-lift-view" @click="jump">
<image src="../../static/baseIcon/download.png" style="width: 16px;height: 16px;" mode="aspectFill">
</image>
<text class="centre-lift-view-text">报表下载</text>
</view>
<text class="centre-lift-text">总授信{{info.creditLimit}}</text>
<text class="centre-lift-text">总用信{{info.useLimit}}</text>
</view>
</view>
@ -36,7 +48,7 @@
</view> -->
<view style="margin-top: 30px;padding-bottom: 50px; display: flex;flex-direction: column;">
<view style="margin-top: 3px;padding-bottom: 50px; display: flex;flex-direction: column;">
<view class="layout" @click="itemClick('1')">
@ -49,7 +61,8 @@
<text class="content-text2">{{info.accountsBalanceWan }}万元</text>
</view>
<image src="../../static/baseIcon/zy.png" mode="aspectFill" style="width: 14px;height: 14px;"></image>
<image src="../../static/baseIcon/zy.png" mode="aspectFill" style="width: 14px;height: 14px;">
</image>
</view>
<view class="layout" @click="itemClick('2')">
@ -63,7 +76,8 @@
<text class="content-text2">{{info.accountsReceivableWan }}万元</text>
</view>
<image src="../../static/baseIcon/zy.png" mode="aspectFill" style="width: 14px;height: 14px;"></image>
<image src="../../static/baseIcon/zy.png" mode="aspectFill" style="width: 14px;height: 14px;">
</image>
</view>
<view class="layout" @click="itemClick('3')">
@ -77,7 +91,8 @@
<text class="content-text2">{{info.stockAmountWan }}万元</text>
</view>
<image src="../../static/baseIcon/zy.png" mode="aspectFill" style="width: 14px;height: 14px;"></image>
<image src="../../static/baseIcon/zy.png" mode="aspectFill" style="width: 14px;height: 14px;">
</image>
</view>
<view class="layout" @click="itemClick('4')">
@ -91,10 +106,11 @@
<text class="content-text2">{{info.transitAmountWan }}万元</text>
</view>
<image src="../../static/baseIcon/zy.png" mode="aspectFill" style="width: 14px;height: 14px;"></image>
<image src="../../static/baseIcon/zy.png" mode="aspectFill" style="width: 14px;height: 14px;">
</image>
</view>
<view class="layout" @click="itemClick('5')">
<view class="layout" @click="itemClick('5')" style="border-bottom: none;">
<image src="https://supervise.yxtsoft.com/img/newApp/yfk.png" mode="aspectFill"
style="width: 12px;height: 12px;">
@ -105,24 +121,52 @@
<text class="content-text2">{{info.advancePaymentWan }}万元</text>
</view>
<image src="../../static/baseIcon/zy.png" mode="aspectFill" style="width: 14px;height: 14px;"></image>
<image src="../../static/baseIcon/zy.png" mode="aspectFill" style="width: 14px;height: 14px;">
</image>
</view>
</view>
</view>
<view v-if="!show">
<view style="display:flex;flex-direction: column;justify-content: center;align-items: center;">
<image src="../../static/baseIcon/notData.png" mode="aspectFill" style="width: 150px;height: 150px;">
</image>
<text style="text-align: center;width: 100%; color: #717171;">暂无数据</text>
</view>
</view>
<u-datetime-picker ref="datetimePicker" :closeOnClickOverlay='true' @close="cancelClick"
@cancel="cancelClick" @confirm="confirmClick" :show="datetimeShow" v-model="orderDate" mode="date"
:formatter="formatter">
</u-datetime-picker>
</view>
</template>
<script>
import {
formatTimeTwo,
beforeDay
} from "@/utils/index";
export default {
data() {
return {
show: false,
orderDate: "",
datetimeShow: false,
params: {
projectSid: "",
orderDate: "",
wxCode:"",
userSid:""
wxCode: "",
userSid: ""
},
info: {
projectName: "",
@ -191,6 +235,7 @@
orderDate: option.orderDate,
}
this.orderDate = option.orderDate
},
onShow() {
@ -203,7 +248,45 @@
this.params.userSid = getApp().globalData.sid
},
onReady() {
/* #ifdef MP-WEIXIN */
//
this.$refs.datetimePicker.setFormatter(this.formatter)
/* #endif */
},
methods: {
openDate() {
console.log('openDate')
this.datetimeShow = true
},
formatter(type, value) {
if (type === 'year') {
return `${value}`
}
if (type === 'month') {
return `${value}`
}
if (type === 'day') {
return `${value}`
}
return value
},
cancelClick() {
this.datetimeShow = false
},
confirmClick(date) {
console.log('confirmClick', date)
console.log('confirmClick', formatTimeTwo(parseInt(date.value), "Y-M-D"))
this.params.orderDate = formatTimeTwo(parseInt(date.value), "Y-M-D")
this.info.orderDate = formatTimeTwo(parseInt(date.value), "Y-M-D")
this.datetimeShow = false
this.getServerData()
},
init() {
let that = this
wx.login({
@ -232,12 +315,17 @@
this.$api.getProjectDaily(this.params).then((resp) => {
console.log('1111>>>>>>', resp)
if (resp) {
this.show = true
this.info = resp
this.info.opts = {
rotate: false,
rotateLock: false,
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452",
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272",
"#FC8452",
"#9A60B4",
"#ea7ccc"
],
@ -249,22 +337,22 @@
lineHeight: 30
},
title: {
name: this.info.pledgeRatePercent+"%",
fontSize: 38,
color: "#F6A42F"
name: this.info.pledgeRatePercent + "%",
fontSize: 30,
color: this.info.state == '2' ? "#f00" : "#ccc"
},
subtitle: {
name: "质押率",
fontSize: 20,
color: "#17B0DF"
name: "质押率 " + this.info.bankPledgeRate + "%",
fontSize: 15,
color: "#ccc"
},
extra: {
ring: {
ringWidth: 30,
ringWidth: 35,
activeOpacity: 0.1,
activeRadius: 1,
offsetAngle: 0,
labelWidth: 15,
labelWidth: 20,
border: true,
borderWidth: 3,
borderColor: "#FFFFFF"
@ -308,6 +396,11 @@
this.chartData = JSON.parse(JSON.stringify(res));
}, 500);
} else {
this.show = false
this.params.orderDate = this.orderDate
}
// //
// setTimeout(() => {
// //
@ -336,16 +429,16 @@
// code 410 420
if(e.code==410){
if (e.code == 410) {
uni.redirectTo({
url:"/pages/index/NotPermission"
url: "/pages/index/NotPermission"
})
}
if(e.code==420){
if (e.code == 420) {
uni.redirectTo({
url:"/pages/index/BindPhone"
url: "/pages/index/BindPhone"
})
}
@ -450,8 +543,6 @@
.top-name {
font-size: 16px;
color: #000;
font-weight: 600;
font-family: sans-serif;
}
.top-date {
@ -460,6 +551,31 @@
}
}
.download {
position: absolute;
top: 100px;
right: 5px;
background-color: #fff;
display: flex;
align-items: center;
flex-direction: row;
.download-lift-view {
z-index: 2222;
margin-right: 20px;
display: flex;
align-items: center;
flex-direction: row;
.download-lift-view-text {
margin-left: 10px;
font-size: 14px;
color: #018AD2;
}
}
}
.centre {
background-color: #fff;
display: flex;
@ -478,23 +594,15 @@
justify-content: space-between;
.centre-lift-text {
font-size: 14px;
flex: 1;
text-align: center;
font-size: 13px;
color: #191919;
font-weight: 550;
font-family: sans-serif;
}
.centre-lift-view {
display: flex;
align-items: center;
flex-direction: row;
.centre-lift-view-text {
margin-left: 10px;
font-size: 14px;
color: #018AD2;
}
}
}
@ -507,12 +615,11 @@
.layout {
background: #fff;
border-radius: 10px;
padding: 15px;
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: 10px;
border-bottom: 1px #eee solid;
.content {
margin-left: 10px;

9
supervise-uniapp/pages/index/interestAccount.vue

@ -0,0 +1,9 @@
<template>
<web-view src="https://mp.weixin.qq.com/s?__biz=Mzk0OTUxNjgyNQ==&mid=2247483688&idx=1&sn=9e56712d0ea540d6c53feeee6af94fca&chksm=c3566e5ef421e748d0d3de4af6a1bbc595df0a07f866e8b7f3fc3be0284c815f71b61f9584f0#rd"></web-view>
</template>
<script>
</script>
<style>
</style>

BIN
supervise-uniapp/static/baseIcon/calendar.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
supervise-uniapp/static/baseIcon/project.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

27
supervise-uniapp/utils/index.js

@ -16,6 +16,30 @@ function formatNumber(n) {
return n[1] ? n : '0' + n
}
// 获取前一天
//只需要改变这里就OK,-1是昨天,0是今天,1是后一天
function beforeDay (today, addDayCount) {
let date;
if (today) {
date = new Date(today);
} else {
date = new Date();
}
date.setDate(date.getDate() + addDayCount); //获取AddDayCount天后的日期
let y = date.getFullYear();
let m = date.getMonth() + 1; //获取当前月份的日期
let d = date.getDate();
if (m < 10) {
m = '0' + m;
};
if (d < 10) {
d = '0' + d;
};
console.log(y + "-" + m + "-" + d)
return y + "-" + m + "-" + d;
}
/**
* 时间戳转化为年
* number: 传入时间戳
@ -43,5 +67,6 @@ function formatTimeTwo(number, format) {
module.exports = {
formatTime: formatTime,
formatTimeTwo: formatTimeTwo
formatTimeTwo: formatTimeTwo ,
beforeDay: beforeDay
}

2
yxt-portal-ui/src/views/Home/Home.vue

@ -460,7 +460,7 @@
window.open('http://192.168.1.102:9531/#/' + '?token=' + getStorage(), '_blank')
// window.open('/organizational/#/' + '?token=' + getStorage(), '_blank')
} else if (index === 8) {
window.open('http://192.168.1.101:9531/#/' + '?token=' + getStorage(), '_blank')
window.open('http://192.168.1.103:9531/#/' + '?token=' + getStorage(), '_blank')
// window.open('/crm/#/' + '?token=' + getStorage(), '_blank')
} else if (index === 9) {
// window.open('http://192.168.1.102:9531/#/' + '?token=' + getStorage(), '_blank')

Loading…
Cancel
Save