小程序开发

dev_xd
lj7788@126.com 2025-08-02 15:44:20 +08:00
parent e9653574d6
commit daf407f5af
16 changed files with 1293 additions and 929 deletions

View File

@ -1,6 +1,6 @@
{ {
"files.associations": { "files.associations": {
"*.wxml": "xml", "*.wxml": "html",
"*.wxss": "css", "*.wxss": "css",
"*.wxs": "javascript" "*.wxs": "javascript"
}, },

View File

@ -1,123 +1,123 @@
{ {
"pages": [ "pages": [
"pages/login/login", "pages/login/login",
"pages/project_qr/index" "pages/project_qr/index"
], ],
"subpackages": [ "subpackages": [
{ {
"root": "pageage", "root": "pageage",
"name": "pageage", "name": "pageage",
"pages": [ "pages": [
"project_flowable/approveTask/index", "project_flowable/approveTask/index",
"project_flowable/detailTask/index", "project_flowable/detailTask/index",
"project_flowable/subDepts/index", "project_flowable/subDepts/index",
"project_flowable/subDeptsUsers/index", "project_flowable/subDeptsUsers/index",
"project_video/list/index", "project_video/list/index",
"project_video/info/index", "project_video/info/index",
"project_list/index", "project_list/index",
"project_info/index", "project_info/index",
"project_more/index", "project_more/index",
"project_safety/index", "project_safety/index",
"project_quality/index", "project_quality/index",
"sign_mags/index", "sign_mags/index",
"project_problemmodify/list/index", "project_problemmodify/list/index",
"project_problemmodify/info/index", "project_problemmodify/info/index",
"project_problemmodify/modify/index", "project_problemmodify/modify/index",
"project_problemmodify/check/index", "project_problemmodify/check/index",
"project_problemmodify/add/index", "project_problemmodify/add/index",
"project_problemmodify/draft/index", "project_problemmodify/draft/index",
"project_subdepts/list/index", "project_subdepts/list/index",
"project_subdepts/add/index", "project_subdepts/add/index",
"project_subdepts/info/index", "project_subdepts/info/index",
"project_subgroups/list/index", "project_subgroups/list/index",
"project_subgroups/add/index", "project_subgroups/add/index",
"project_subgroups/info/index", "project_subgroups/info/index",
"project_subusers/list/index", "project_subusers/list/index",
"project_subusers/add/index", "project_subusers/add/index",
"project_subusers/info/index", "project_subusers/info/index",
"project_magusers/list/index", "project_magusers/list/index",
"project_magusers/add/index", "project_magusers/add/index",
"project_magusers/info/index", "project_magusers/info/index",
"project_schedule/list/index", "project_schedule/list/index",
"project_schedule/add/index", "project_schedule/add/index",
"project_schedule/info/index", "project_schedule/info/index",
"project_checked/list/index", "project_checked/list/index",
"project_checked/add/index", "project_checked/add/index",
"project_checked/info/index", "project_checked/info/index",
"project_checked/handle/index" "project_checked/handle/index"
], ],
"independent": false "independent": false
} }
], ],
"usingComponents": { "usingComponents": {
"van-row": "@vant/weapp/row", "van-row": "@vant/weapp/row",
"van-col": "@vant/weapp/col", "van-col": "@vant/weapp/col",
"van-popup": "@vant/weapp/popup/index", "van-popup": "@vant/weapp/popup/index",
"van-picker": "@vant/weapp/picker/index", "van-picker": "@vant/weapp/picker/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index", "van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-radio": "@vant/weapp/radio/index", "van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index", "van-radio-group": "@vant/weapp/radio-group/index",
"van-toast": "@vant/weapp/toast/index", "van-toast": "@vant/weapp/toast/index",
"ec-canvas": "ec-canvas/ec-canvas", "ec-canvas": "ec-canvas/ec-canvas",
"van-sticky": "@vant/weapp/sticky", "van-sticky": "@vant/weapp/sticky",
"van-calendar": "@vant/weapp/calendar/index", "van-calendar": "@vant/weapp/calendar/index",
"van-icon": "@vant/weapp/icon/index", "van-icon": "@vant/weapp/icon/index",
"van-image": "@vant/weapp/image/index", "van-image": "@vant/weapp/image/index",
"pie-chart": "pages/components/pie-chart/index", "pie-chart": "pages/components/pie-chart/index",
"deep-select": "pages/components/deep-select/index", "deep-select": "pages/components/deep-select/index",
"select-btn": "pages/components/select-btn/index", "select-btn": "pages/components/select-btn/index",
"bar-chart": "pages/components/bar-chart/index", "bar-chart": "pages/components/bar-chart/index",
"bar-chart-warning": "pages/components/bar-chart-warning/index", "bar-chart-warning": "pages/components/bar-chart-warning/index",
"pz-screen": "pages/components/pz-screen/index", "pz-screen": "pages/components/pz-screen/index",
"pz-screen-training": "pages/components/pz-screen-training/index", "pz-screen-training": "pages/components/pz-screen-training/index",
"pz-screen-training-index": "pages/components/pz-screen-training-index/index", "pz-screen-training-index": "pages/components/pz-screen-training-index/index",
"select-date": "pages/components/select-date/index", "select-date": "pages/components/select-date/index",
"voucher-select": "pages/components/voucher-select/index", "voucher-select": "pages/components/voucher-select/index",
"voucher-selects": "pages/components/voucher-selects/index", "voucher-selects": "pages/components/voucher-selects/index",
"voucher-selected": "pages/components/voucher-selected/index", "voucher-selected": "pages/components/voucher-selected/index",
"voucher-date": "pages/components/voucher-date/index", "voucher-date": "pages/components/voucher-date/index",
"voucher-datetime": "pages/components/voucher-datetime/index", "voucher-datetime": "pages/components/voucher-datetime/index",
"file-uploader": "pages/components/file-uploader/index", "file-uploader": "pages/components/file-uploader/index",
"file-uploader-all": "pages/components/file-uploader-all/index", "file-uploader-all": "pages/components/file-uploader-all/index",
"project-select": "pages/components/project-select/index", "project-select": "pages/components/project-select/index",
"safety-pie-chart": "./components/safety-pie-chart/index", "safety-pie-chart": "./components/safety-pie-chart/index",
"safety-pie-charts": "./components/safety-pie-charts/index", "safety-pie-charts": "./components/safety-pie-charts/index",
"safety-bar-chart": "./components/safety-bar-chart/index", "safety-bar-chart": "./components/safety-bar-chart/index",
"safety-bar-charts": "./components/safety-bar-charts/index", "safety-bar-charts": "./components/safety-bar-charts/index",
"safety-bar-chartss": "./components/safety-bar-chartss/index", "safety-bar-chartss": "./components/safety-bar-chartss/index",
"voucher-many-select": "pages/components/voucher-many-select/index", "voucher-many-select": "pages/components/voucher-many-select/index",
"sign": "pages/components/sign/sign", "sign": "pages/components/sign/sign",
"jyq-result": "pages/components/jyq-result/index", "jyq-result": "pages/components/jyq-result/index",
"safety-number": "./components/number/index", "safety-number": "./components/number/index",
"select-person": "./components/select-person/index", "select-person": "./components/select-person/index",
"select-roles": "./components/select-roles/index", "select-roles": "./components/select-roles/index",
"select-group-person": "./components/select-group-person/index", "select-group-person": "./components/select-group-person/index",
"select-group-position": "./components/select-group-position/index", "select-group-position": "./components/select-group-position/index",
"select-group-plan": "./components/select-group-plan/index", "select-group-plan": "./components/select-group-plan/index",
"van-dropdown-menu": "@vant/weapp/dropdown-menu/index", "van-dropdown-menu": "@vant/weapp/dropdown-menu/index",
"van-dropdown-item": "@vant/weapp/dropdown-item/index", "van-dropdown-item": "@vant/weapp/dropdown-item/index",
"curve-echarts": "pages/components/curve-echarts/index", "curve-echarts": "pages/components/curve-echarts/index",
"user-infos": "pages/components/user-infos/index" "user-infos": "pages/components/user-infos/index"
}, },
"plugins": { "plugins": {
"ezplayer": { "ezplayer": {
"version": "1.0.9", "version": "1.0.9",
"provider": "wxf2b3a0262975d8c2" "provider": "wxf2b3a0262975d8c2"
} }
}, },
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#191d28", "navigationBarBackgroundColor": "#191d28",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
}, },
"style": "v2", "style": "v2",
"sitemapLocation": "sitemap.json", "sitemapLocation": "sitemap.json",
"permission": { "permission": {
"scope.userLocation": { "scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示" "desc": "你的位置信息将用于小程序位置接口的效果展示"
} }
}, },
"requiredPrivateInfos": [ "requiredPrivateInfos": [
"getLocation" "getLocation"
] ]
} }

View File

@ -1,4 +1,4 @@
<!--components/bar-chart/index.wxml--> <!--components/bar-chart/index.wxml-->
<view class="chart_canvas" style="height:{{height+'rpx'}}"> <view class="chart_canvas" style="height:{{height+'rpx'}}">
<ec-canvas id="{{ chartId }}" ec="{{ ec }}"></ec-canvas> <ec-canvas id="{{ chartId }}" ec="{{ ec }}" force-use-old-canvas="true"></ec-canvas>
</view> </view>

View File

@ -1,227 +1,240 @@
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
dataTree: { dataTree: {
type: Array, type: Array,
value: [] value: []
},
treeListIndex: { // 当期树形列表的索引
type: Number,
value: 1
},
isOpenAll: { // 是否展开全部节点
type: Boolean,
value: false
},
showCheckBox: { // 是否显示选择框
type: Boolean,
value: true
}
}, },
observers: { treeListIndex: { // 当期树形列表的索引
'dataTree': function (params) { type: Number,
this.setData({ value: 1
tree: this._initSourceData(params)
})
}
}, },
/** isOpenAll: { // 是否展开全部节点
* 组件的初始数据 type: Boolean,
*/ value: false
data: {
tree: [],
allChoiceIdList: [] // 所有选中的id数组
}, },
/** showCheckBox: { // 是否显示选择框
* 组件的方法列表 type: Boolean,
*/ value: true
methods: { },
isOpen(e) { multiple: { // 是否多选
const open = 'tree[' + e.currentTarget.dataset.index + '].open' type: Boolean,
this.setData({ value: true
[open]: !this.data.tree[e.currentTarget.dataset.index].open
})
},
_initSourceData(nodes) {
nodes.forEach(element => {
if (element.checked === undefined) element.checked = 0
element.open = this.properties.isOpenAll // 是否展开
if (element.children && element.children.length > 0) element.children = this._initSourceData(element.children)
})
return nodes
},
/**
* 选择节点
* @param {*} e
*/
select(e) {
this._initSourceData(this.data.tree);
let item = e.currentTarget.dataset.item
if(item.children && item.children.length>0){
wx.showToast({
title: "请选择进度计划任务!",
icon: 'none',
duration: 600,
mask: true
});
return false;
}
item = this._handleClickItem(item)
this.data.tree = this._updateTree(this.data.tree, item)
this.setData({
tree: this.data.tree
})
this.data.allChoiceIdList = this.getAllChoiceId(this.data.tree)
this.triggerEvent('select', {
item: item,
idList: this.data.allChoiceIdList
}, {
bubbles: true,
composed: true
})
this.triggerEvent('clickItem', {
item: item
}, {
bubbles: true,
composed: true
})
},
// 选择冒泡事件
handleSelect(e) {
let parent = e.currentTarget.dataset.parent
let currentTap = e.detail.item
console.log('parent节点:', parent)
console.log('currentTap节点:', currentTap)
// 修正它的父节点
parent.children = this._updateTree(parent.children, currentTap)
const {
half,
all,
none
} = this.getChildState(parent.children)
// console.log(`half:${half},all:${all},none:${none}`)
if (half) parent.checked = -1
if (all) parent.checked = 1
if (none) parent.checked = 0
// 修正整个tree
this.data.tree = this._updateTree(this.data.tree, parent)
this.setData({
tree: this.data.tree
})
this.data.allChoiceIdList = this.getAllChoiceId(this.data.tree)
this.triggerEvent('select', {
item: parent,
idList: this.data.allChoiceIdList
}, {
bubbles: true,
composed: true
})
},
/**
* @method 处理点击选择
* @param {Object} node 节点对象
* @returns {Object} node 处理完毕的节点
* @description 有子节点则全选中或全取消当前为最底层单节点则选中或单取消
*/
_handleClickItem(node) {
switch (node.checked) {
case 0:
node.checked = 1
if (node.children && node.children.length > 0) node.children = this._allChoice(node.children)
break;
case 1:
node.checked = 0
if (node.children && node.children.length > 0) node.children = this._allCancel(node.children)
break;
default:
node.checked = 1
if (node.children && node.children.length > 0) node.children = this._allChoice(node.children)
break;
}
return node
},
/**
* @method 全选
* @param {Array} nodes 节点数组
* @returns {Array} nodes 处理完毕的节点数组
*/
_allChoice(nodes) {
if (nodes.length <= 0) return
for (let i = 0; i < nodes.length; i++) {
nodes[i].checked = 1
if (nodes[i].children && nodes[i].children.length > 0) nodes[i].children = this._allChoice(nodes[i].children)
}
return nodes
},
/**
* @method 全取消
* @param {Array} nodes 节点数组
* @returns {Array} nodes 处理完毕的节点数组
*/
_allCancel(nodes) {
if (nodes.length <= 0) return
for (let i = 0; i < nodes.length; i++) {
nodes[i].checked = 0
if (nodes[i].children && nodes[i].children.length > 0) nodes[i].children = this._allCancel(nodes[i].children)
}
return nodes
},
/**
* @method 更新tree
* @param {Array} tree 节点树
* @param {Object} newItem 需要替换新节点
* @description 找到tree中目标进行替换
*/
_updateTree(tree, newItem) {
if (!tree || tree.length <= 0) return
for (let i = 0; i < tree.length; i++) {
if (tree[i].id === newItem.id) {
tree[i] = newItem
break
} else {
if (tree[i].children && tree[i].children.length > 0) {
tree[i].children = this._updateTree(tree[i].children, newItem)
}
}
}
return tree
},
/**
* @method 获取子节点的状态
* @param {Array} node 节点数组
*/
getChildState(node) {
let all = true;
let none = true;
for (let i = 0, j = node.length; i < j; i++) {
const n = node[i];
if (n.checked === 1 || n.checked === -1) {
none = none && false;
}
if (n.checked === 0 || n.checked === -1) {
all = all && false
}
}
return {
all,
none,
half: !all && !none
};
},
// 获取所有选中的节点id
getAllChoiceId(nodes, res = []) {
for (let i = 0; i < nodes.length; i++) {
if (nodes[i].checked === 1) {
var obj = {}
obj.planId = nodes[i].id
obj.planName = nodes[i].taskName
res.push(obj)
}
if (nodes[i].children && nodes[i].children.length > 0) this.getAllChoiceId(nodes[i].children, res)
}
return res
}
} }
},
observers: {
'dataTree': function (params) {
this.setData({
tree: this._initSourceData(params)
})
}
},
/**
* 组件的初始数据
*/
data: {
tree: [],
allChoiceIdList: [] // 所有选中的id数组
},
/**
* 组件的方法列表
*/
methods: {
isOpen(e) {
const open = 'tree[' + e.currentTarget.dataset.index + '].open'
this.setData({
[open]: !this.data.tree[e.currentTarget.dataset.index].open
})
},
_initSourceData(nodes) {
nodes.forEach(element => {
if (element.checked === undefined) element.checked = 0
element.open = this.properties.isOpenAll // 是否展开
if (element.children && element.children.length > 0) element.children = this._initSourceData(element.children)
})
return nodes
},
/**
* 选择节点
* @param {*} e
*/
select(e) {
this._initSourceData(this.data.tree);
let item = e.currentTarget.dataset.item
if (item.children && item.children.length > 0) {
wx.showToast({
title: "请选择进度计划任务!",
icon: 'none',
duration: 600,
mask: true
});
return false;
}
item = this._handleClickItem(item)
this.data.tree = this._updateTree(this.data.tree, item)
this.setData({
tree: this.data.tree
})
this.data.allChoiceIdList = this.getAllChoiceId(this.data.tree)
this.triggerEvent('select', {
item: item,
idList: this.data.allChoiceIdList
}, {
bubbles: true,
composed: true
})
this.triggerEvent('clickItem', {
item: item
}, {
bubbles: true,
composed: true
})
},
// 选择冒泡事件
handleSelect(e) {
let parent = e.currentTarget.dataset.parent
let currentTap = e.detail.item
console.log('parent节点:', parent)
console.log('currentTap节点:', currentTap)
// 修正它的父节点
parent.children = this._updateTree(parent.children, currentTap)
const {
half,
all,
none
} = this.getChildState(parent.children)
// console.log(`half:${half},all:${all},none:${none}`)
if (half) parent.checked = -1
if (all) parent.checked = 1
if (none) parent.checked = 0
// 修正整个tree
this.data.tree = this._updateTree(this.data.tree, parent)
this.setData({
tree: this.data.tree
})
this.data.allChoiceIdList = this.getAllChoiceId(this.data.tree)
this.triggerEvent('select', {
item: parent,
idList: this.data.allChoiceIdList
}, {
bubbles: true,
composed: true
})
},
handleClickItem(e) {
let item = e.detail.item;
this.triggerEvent('clickItem', {
item: item
}, {
bubbles: true,
composed: true
})
},
/**
* @method 处理点击选择
* @param {Object} node 节点对象
* @returns {Object} node 处理完毕的节点
* @description 有子节点则全选中或全取消当前为最底层单节点则选中或单取消
*/
_handleClickItem(node) {
switch (node.checked) {
case 0:
node.checked = 1
if (node.children && node.children.length > 0) node.children = this._allChoice(node.children)
break;
case 1:
node.checked = 0
if (node.children && node.children.length > 0) node.children = this._allCancel(node.children)
break;
default:
node.checked = 1
if (node.children && node.children.length > 0) node.children = this._allChoice(node.children)
break;
}
return node
},
/**
* @method 全选
* @param {Array} nodes 节点数组
* @returns {Array} nodes 处理完毕的节点数组
*/
_allChoice(nodes) {
if (nodes.length <= 0) return
for (let i = 0; i < nodes.length; i++) {
nodes[i].checked = 1
if (nodes[i].children && nodes[i].children.length > 0) nodes[i].children = this._allChoice(nodes[i].children)
}
return nodes
},
/**
* @method 全取消
* @param {Array} nodes 节点数组
* @returns {Array} nodes 处理完毕的节点数组
*/
_allCancel(nodes) {
if (nodes.length <= 0) return
for (let i = 0; i < nodes.length; i++) {
nodes[i].checked = 0
if (nodes[i].children && nodes[i].children.length > 0) nodes[i].children = this._allCancel(nodes[i].children)
}
return nodes
},
/**
* @method 更新tree
* @param {Array} tree 节点树
* @param {Object} newItem 需要替换新节点
* @description 找到tree中目标进行替换
*/
_updateTree(tree, newItem) {
if (!tree || tree.length <= 0) return
for (let i = 0; i < tree.length; i++) {
if (tree[i].id === newItem.id) {
tree[i] = newItem
break
} else {
if (tree[i].children && tree[i].children.length > 0) {
tree[i].children = this._updateTree(tree[i].children, newItem)
}
}
}
return tree
},
/**
* @method 获取子节点的状态
* @param {Array} node 节点数组
*/
getChildState(node) {
let all = true;
let none = true;
for (let i = 0, j = node.length; i < j; i++) {
const n = node[i];
if (n.checked === 1 || n.checked === -1) {
none = none && false;
}
if (n.checked === 0 || n.checked === -1) {
all = all && false
}
}
return {
all,
none,
half: !all && !none
};
},
// 获取所有选中的节点id
getAllChoiceId(nodes, res = []) {
for (let i = 0; i < nodes.length; i++) {
if (nodes[i].checked === 1) {
var obj = {}
obj.planId = nodes[i].id
obj.planName = nodes[i].taskName
res.push(obj)
}
if (nodes[i].children && nodes[i].children.length > 0) this.getAllChoiceId(nodes[i].children, res)
}
return res
}
}
}) })

View File

@ -1,22 +1,28 @@
<view wx:for="{{tree}}" wx:key="id" class="tree_container"> <view wx:for="{{tree}}" wx:key="id" class="tree_container">
<!-- 一级菜单 --> <!-- 一级菜单 -->
<view style="margin-left: {{treeListIndex*20}}rpx" class="tree-item"> <view style="margin-left: {{treeListIndex*20}}rpx" class="tree-item">
<view class="tree-item-onOff" wx:if="{{item.children && item.children.length > 0}}" bindtap="isOpen" data-index="{{index}}"> <view class="tree-item-onOff" wx:if="{{item.children && item.children.length > 0}}" bindtap="isOpen"
<van-icon name="arrow-down" s class="{{item.open ? 'expand' : 'collapse'}}" /> data-index="{{index}}">
</view> <van-icon name="arrow-down" s class="{{item.open ? 'expand' : 'collapse'}}" />
<view class="tree-item-onOff" wx:else></view>
<view class="block_" bindtap="select" data-item="{{item}}" data-index="{{index}}">
<block wx:if="{{showCheckBox}}">
<image wx:if="{{item.checked === 1}}" src="https://xiangguan.sxyanzhu.com/profile/static/images/choice.png" class="check-box"></image>
<image wx:if="{{item.checked === 0}}" src="/images/unchoice.png" class="check-box"></image>
<image wx:if="{{item.checked === -1}}" src="/images/unfullChoice.png" class="check-box"></image>
</block>
<view class="tree-item-name">
<text class="tree-item-title {{item.checked === 1 ? 'tree-item-name-select' : '' }}">{{item.taskName}}<text class="tree-item-suffix"> {{item.scheduleNode}} % </text></text>
</view>
</view>
</view> </view>
<!-- 二级菜单 --> <view class="tree-item-onOff" wx:else></view>
<categoryTree wx:if="{{item.children && item.children.length > 0 && item.open}}" data-parent="{{item}}" dataTree='{{ item.children }}' isOpenAll="{{isOpenAll}}" showCheckBox="{{showCheckBox}}" treeListIndex="{{treeListIndex+1}}" catch:select="handleSelect" /> <view class="block_" bindtap="select" data-item="{{item}}" data-index="{{index}}">
<block wx:if="{{showCheckBox}}">
<image wx:if="{{item.checked === 1}}" src="https://xiangguan.sxyanzhu.com/profile/static/images/choice.png"
class="check-box"></image>
<image wx:if="{{item.checked === 0}}" src="/images/unchoice.png" class="check-box"></image>
<image wx:if="{{item.checked === -1}}" src="/images/unfullChoice.png" class="check-box"></image>
</block>
<view class="tree-item-name">
<text
class="tree-item-title {{item.checked === 1 && multiple ? 'tree-item-name-select' : '' }}">{{item.taskName}}<text
class="tree-item-suffix"> {{item.scheduleNode}} % </text></text>
</view>
</view>
</view>
<!-- 二级菜单 -->
<categoryTree wx:if="{{item.children && item.children.length > 0 && item.open}}" multiple="{{multiple}}"
data-parent="{{item}}" dataTree='{{ item.children }}' isOpenAll="{{isOpenAll}}" showCheckBox="{{showCheckBox}}"
treeListIndex="{{treeListIndex+1}}" catch:select="handleSelect" catch:clickItem="handleClickItem" />
</view> </view>

View File

@ -1,66 +1,209 @@
// pageage/project_checked/add/index.js // pageage/project_checked/add/index.js
import config from '../../../config'
import fmt from '../../../utils/date.js'
import {
getToken,
getUserInfo
} from '../../../utils/auth'
import {
projectCheckedList,
projectCheckedListCount
} from '../../../api/project'
import {
findPlanDatas,
findRecursionPlan,
findPreviousSchedule,
submitPlanSchedule
} from '../../../api/project'
const app = getApp()
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
maxDate: new Date(2088, 1, 1).getTime(),
minDate: new Date().getTime() + (3600 * 48 * 1000),
form: {
taskName: '',
task: null,
intro: '',//验收描述
imageUrls: [],
groupDeptUser: '',//班组长
checkingDate: '',//验收时间
technicianUser: '',//技术专员
superviseUser: '',//监理专员
}, },
projectUserInfo: {},
projectId: "",
projectName: "",
initData: {},
pageNum: 1,
pageSize: 10,
total: 0,
listData: [],
//任务计划
picker: false,
planOptions: [],
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
if (!getToken()) {
}, wx.redirectTo({
url: '../../../pages/login/login',
/** })
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
} }
const proUserInfo = getUserInfo();
this.setData({
projectUserInfo: proUserInfo.projectUserInfo,
projectId: app.globalData.useProjectId,
projectName: app.globalData.useProjectName,
initData: {
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
},
pageNum: 1,
pageSize: 10,
listData: [],
total: 0,
form: {
taskName: '',
task: null,
intro: '',
checkingDate: fmt(new Date()).format("YYYY-MM-DD HH:mm:ss"),
}
});
this.initPlanDatas();
},
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.useProjectId = projectId;
app.globalData.useProjectName = projectName;
this.onLoad();
},
/**
* 初始化计划
*/
initPlanDatas() {
findPlanDatas(app.globalData.useProjectId).then((res) => {
let treeDatas = this.buildTree(res.data, 1, "");
this.setData({
planOptions: treeDatas
})
});
},
closePicker() {
this.setData({
picker: false
})
},
/**
* 打开选择窗
*/
openPicker() {
this.setData({
picker: true
})
},
/**
* 构建树结构
* @param {*} all
* @param {*} id
*/
buildTree(all, id, path) {
let tmps = all.filter((d) => d.parentId == id);
if (tmps.length > 0) {
tmps.forEach((it) => {
it.fullPath = path ? path + "/" + it.taskName : it.taskName;
it.children = this.buildTree(all, it.taskId, it.fullPath);
});
}
return tmps;
},
handleClick: function (e) {
let item = e.detail.item;
if (item) {
this.setData({
form: {
task: item,
taskName: item.fullPath
},
picker: false
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
returnToPage: function () {
/*关闭当前页面,跳转到其它页面。*/
wx.redirectTo({
url: '../list/index',
})
},
onScrollToLower() {
let nal = Math.ceil(this.data.total / this.data.pageSize);
if (this.data.pageNum < nal) {
this.setData({
//pageNum: this.data.pageNum + 1
});
//this.getListData(this.data.activeState);
} else {
console.log("已经到底了,没有数据可加载!!!");
}
},
}) })

View File

@ -1,3 +1,4 @@
{ {
"usingComponents": {} "usingComponents": {},
"navigationStyle": "custom"
} }

View File

@ -0,0 +1,47 @@
/* pageage/project_checked/add/index.wxss */
.project-checked-add {
.max_content_scroll {
color: #89a4eb;
font-size: 28rpx;
padding: 60rpx 30rpx 30rpx;
width: calc(100% - 60rpx);
position: relative;
top: 140rpx;
.mt40 {
margin-top: 40rpx;
}
.add-info {
background-color: #514f4f8a;
color: #888;
margin-top: 16rpx;
line-height: 60rpx;
border-radius: 30rpx;
padding: 0rpx 30rpx;
}
.rectifier_title {
position: relative;
background: #27304f;
border-radius: 15rpx;
text-align: center;
padding: 20rpx 15rpx;
}
.rectifier_close {
position: absolute;
width: 50rpx;
height: 50rpx;
right: 20rpx;
top: 12rpx;
line-height: 60rpx;
text-align: center;
}
.add_textarea {
height: 60rpx;
}
}
}

View File

@ -1,2 +1,124 @@
<!--pageage/project_checked/add/index.wxml--> <wxs module="format" src="/utils/format.wxs"></wxs>
<text>pageage/project_checked/add/index.wxml</text> <view class="project-checked-add">
<view class="header_title ">
<view class="header_title_row">
<van-row>
<van-col span="4">
<view class="header_img" bindtap="returnToPage">
<image src="/images/left.png"></image>
</view>
</van-col>
<van-col span="15">
<view class="header_name">增加项目举牌验收</view>
</van-col>
</van-row>
</view>
</view>
<scroll-view class="max_content_scroll" type="list" scroll-y bindscrolltolower="onScrollToLower"
style="padding:30rpx">
<project-select init="{{initData}}" bindchange="onProjectSelect" id="projectSel"></project-select>
<view class="mt40">分包单位</view>
<view class="add-info">{{projectUserInfo.subDeptName}}</view>
<view class="mt40 markers inspect_info_title">工程部位</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写选择工程计划" placeholder-style="color:#6777aa;" bindtap="openPicker"
disabled model:value="{{form.taskName}}" />
<van-popup show="{{ picker }}" bind:close="closePicker" position="bottom">
<view class="rectifier_max">
<view class="rectifier_title">
<view class="rectifier_text">选择工程计划</view>
<view class="rectifier_close" bindtap="closePicker">
<van-icon name="cross" />
</view>
</view>
<view class="rectifier_list">
<view class="rectifier_list_height">
<select-group-plan dataTree="{{planOptions}}" isOpenAll="{{fales}}" showCheckBox="{{fales}}"
multiple="{{false}}" bind:clickItem="handleClick" />
</view>
</view>
</view>
</van-popup>
</view>
<view class="mt40 markers inspect_info_title">技术专员</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写选择工程计划" placeholder-style="color:#6777aa;" bindtap="openPicker"
disabled model:value="{{form.taskName}}" />
<van-popup show="{{ picker }}" bind:close="closePicker" position="bottom">
<view class="rectifier_max">
<view class="rectifier_title">
<view class="rectifier_text">选择工程计划</view>
<view class="rectifier_close" bindtap="closePicker">
<van-icon name="cross" />
</view>
</view>
<view class="rectifier_list">
<view class="rectifier_list_height">
<select-group-plan dataTree="{{planOptions}}" isOpenAll="{{fales}}" showCheckBox="{{fales}}"
multiple="{{false}}" bind:clickItem="handleClick" />
</view>
</view>
</view>
</van-popup>
</view>
<view class="mt40 markers inspect_info_title">监理员</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写选择工程计划" placeholder-style="color:#6777aa;" bindtap="openPicker"
disabled model:value="{{form.taskName}}" />
<van-popup show="{{ picker }}" bind:close="closePicker" position="bottom">
<view class="rectifier_max">
<view class="rectifier_title">
<view class="rectifier_text">选择工程计划</view>
<view class="rectifier_close" bindtap="closePicker">
<van-icon name="cross" />
</view>
</view>
<view class="rectifier_list">
<view class="rectifier_list_height">
<select-group-plan dataTree="{{planOptions}}" isOpenAll="{{fales}}" showCheckBox="{{fales}}"
multiple="{{false}}" bind:clickItem="handleClick" />
</view>
</view>
</view>
</van-popup>
</view>
<view class="mt40 markers inspect_info_title">结果描述</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写结果描述" placeholder-style="color:#6777aa;"
model:value="{{form.intro}}" />
</view>
<view class="mt40 markers inspect_info_title">验收时间</view>
<view class="inspect_info_content">
<voucher-datetime counts="5" placeholder="请选择完成时间" minDate="{{minDate}}" maxDate="{{maxDate}}"
model:value="{{form.checkingDate}}" currentDate="{{form.checkingDate}}"></voucher-datetime>
</view>
<view class="mt40 markers inspect_info_title">验收照片</view>
<view class="inspect_info_content">
<view class="inspect_info_content" style="margin-left: 10px;">
<file-uploader bindimages="onImagesArr"></file-uploader>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="returnToPage">取消</view>
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="submitSave">确认</view>
</view>
</scroll-view>
</view>

View File

@ -1 +1,39 @@
/* pageage/project_checked/add/index.wxss */ /* pageage/project_checked/add/index.wxss */
.project-checked-add .max_content_scroll {
color: #89a4eb;
font-size: 28rpx;
padding: 60rpx 30rpx 30rpx;
width: calc(100% - 60rpx);
position: relative;
top: 140rpx;
}
.project-checked-add .max_content_scroll .mt40 {
margin-top: 40rpx;
}
.project-checked-add .max_content_scroll .add-info {
background-color: #514f4f8a;
color: #888;
margin-top: 16rpx;
line-height: 60rpx;
border-radius: 30rpx;
padding: 0rpx 30rpx;
}
.project-checked-add .max_content_scroll .rectifier_title {
position: relative;
background: #27304f;
border-radius: 15rpx;
text-align: center;
padding: 20rpx 15rpx;
}
.project-checked-add .max_content_scroll .rectifier_close {
position: absolute;
width: 50rpx;
height: 50rpx;
right: 20rpx;
top: 12rpx;
line-height: 60rpx;
text-align: center;
}
.project-checked-add .max_content_scroll .add_textarea {
height: 60rpx;
}

View File

@ -19,269 +19,298 @@
</view> </view>
<!-- 中间内容 --> <!-- 中间内容 -->
<view class="max_content"> <view class="max_content" style="max-height: calc(100% - 360rpx);overflow-y: auto;">
<project-select init="{{initData}}" bindchange="onProjectSelect"></project-select> <project-select init="{{initData}}" bindchange="onProjectSelect"></project-select>
<view class="gk_open" style="margin-top: 5rpx;border: 1px solid transparent;"> <view class="gk_open" style="margin-top: 5rpx;border: 1px solid transparent;">
<van-collapse value="{{activeNames}}" bind:change="onCollChange"> <van-collapse value="{{activeNames}}" bind:change="onCollChange">
<van-collapse-item title="项目基本信息" name="base"> <van-collapse-item title="项目基本信息" name="base">
<view class="gk_open_con"> <view class="gk_open_con">
<view> <view>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_12.png"></image>项目单位:<text>{{projectInfo.comName}}</text> <image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_12.png"></image>
</view> 项目单位:<text>{{projectInfo.comName}}</text>
<view wx:if="{{projectInfo.province && projectInfo.city}}"> </view>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_1.png"></image>所属区域:<text>{{projectInfo.province+' - '+projectInfo.city}}</text> <view wx:if="{{projectInfo.province && projectInfo.city}}">
</view> <image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_1.png"></image>
<view> 所属区域:<text>{{projectInfo.province+' - '+projectInfo.city}}</text>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_2.png"></image>详细地址:<text>{{projectInfo.projectAddress}}</text> </view>
</view> <view>
<view> <image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_2.png"></image>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_3.png"></image>项目类型:<text>{{projectInfo.projectTypeName}}</text> 详细地址:<text>{{projectInfo.projectAddress}}</text>
</view> </view>
<view wx:if="{{false}}"> <view>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_4.png"></image>总建筑面积:<text>{{projectInfo.totalBuildingArea}}</text> <image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_3.png"></image>
</view> 项目类型:<text>{{projectInfo.projectTypeName}}</text>
<view> </view>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_5.png"></image>计划开工日期:<text>{{projectInfo.scheduledStartTime}}</text> <view wx:if="{{false}}">
</view> <image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_4.png"></image>
<view> 总建筑面积:<text>{{projectInfo.totalBuildingArea}}</text>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_6.png"></image>实际开工日期:<text>{{projectInfo.actualOperatingTime}}</text> </view>
</view> <view>
<view> <image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_5.png"></image>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_7.png"></image>计划竣工日期:<text>{{projectInfo.plannedCompletionTime}}</text> 计划开工日期:<text>{{projectInfo.scheduledStartTime}}</text>
</view> </view>
<view wx:if="{{subDeptUserInfo.subDeptType=='1'}}"> <view>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_8.png"></image>总工期:<text>{{projectInfo.projectTimeLimit + ' 天'}}</text> <image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_6.png"></image>
</view> 实际开工日期:<text>{{projectInfo.actualOperatingTime}}</text>
<view wx:if="{{subDeptUserInfo.subDeptType=='1'}}"> </view>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_10.png"></image>项目负责人:<text>{{projectInfo.projectPerson}}</text> <view>
</view> <image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_7.png"></image>
<view wx:if="{{subDeptUserInfo.subDeptType=='1'}}"> 计划竣工日期:<text>{{projectInfo.plannedCompletionTime}}</text>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_11.png"></image>负责人手机号:<text>{{projectInfo.projectPersonPhone}}</text> </view>
</view> <view wx:if="{{subDeptUserInfo.subDeptType=='1'}}">
<view wx:if="{{subDeptUserInfo.subDeptType=='1'}}"> <image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_8.png"></image>
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_15.png"></image>项目概述:<text>{{projectInfo.projectSummarize}}</text> 总工期:<text>{{projectInfo.projectTimeLimit + ' 天'}}</text>
</view> </view>
</view> <view wx:if="{{subDeptUserInfo.subDeptType=='1'}}">
</van-collapse-item> <image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_10.png"></image>
<van-collapse-item wx:if="{{subDeptUserInfo.subDeptType=='1'}}" title="建设及管理单位信息" name="dept"> 项目负责人:<text>{{projectInfo.projectPerson}}</text>
<view class="construction_unit" wx:for="{{projectDeptsList}}" wx:key="index"> </view>
<view class="construction_unit_image"> <view wx:if="{{subDeptUserInfo.subDeptType=='1'}}">
<image src="https://xiangguan.sxyanzhu.com/profile/static/icon/web_zbdw.png"></image> <image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_11.png"></image>
</view> 负责人手机号:<text>{{projectInfo.projectPersonPhone}}</text>
<view class="construction_unit_list"> </view>
<view class="construction_unit_title">{{item.deptType}}</view> <view wx:if="{{subDeptUserInfo.subDeptType=='1'}}">
<view class="construction_unit_name">{{item.deptName}}</view> <image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_15.png"></image>
<view class="construction_unit_phone" bindtap="calling" data-phone="{{item.phone}}">{{item.leader}} {{item.phone}}</view> 项目概述:<text>{{projectInfo.projectSummarize}}</text>
</view> </view>
</view> </view>
</van-collapse-item> </van-collapse-item>
</van-collapse> <van-collapse-item wx:if="{{subDeptUserInfo.subDeptType=='1'}}" title="建设及管理单位信息" name="dept">
</view> <view class="construction_unit" wx:for="{{projectDeptsList}}" wx:key="index">
<view class="construction_unit_image">
<image src="https://xiangguan.sxyanzhu.com/profile/static/icon/web_zbdw.png"></image>
</view>
<view class="construction_unit_list">
<view class="construction_unit_title">{{item.deptType}}</view>
<view class="construction_unit_name">{{item.deptName}}</view>
<view class="construction_unit_phone" bindtap="calling" data-phone="{{item.phone}}">{{item.leader}}
{{item.phone}}</view>
</view>
</view>
</van-collapse-item>
</van-collapse>
</view>
<view class="echarts_max" wx:if="{{(subDeptUserInfo.subDeptType=='1' || subDeptUserInfo.subDeptType=='4' || subDeptUserInfo.subDeptType=='5') && subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='6' && subDeptUserInfo.userPost!='8'}}"> <view class="echarts_max"
<view class="echarts_min"> wx:if="{{(subDeptUserInfo.subDeptType=='1' || subDeptUserInfo.subDeptType=='4' || subDeptUserInfo.subDeptType=='5') && subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='6' && subDeptUserInfo.userPost!='8'}}">
<view class="eharts_title module_title_flex"> <view class="echarts_min">
劳务人员 <view class="eharts_title module_title_flex">
<!-- <view class="module_see_info" bindtap="goLWGL">查看详情 劳务人员
<!-- <view class="module_see_info" bindtap="goLWGL">查看详情
<van-icon name="arrow" /> <van-icon name="arrow" />
</view> --> </view> -->
</view> </view>
<!-- tab栏切换 --> <!-- tab栏切换 -->
<view class="information-review-tab" bindtap="selectedTab"> <view class="information-review-tab" bindtap="selectedTab">
<view class="{{nactive===index?'active':''}}" data-set="{{index}}" wx:for="{{labourTypeList}}" wx:key="index"> <view class="{{nactive===index?'active':''}}" data-set="{{index}}" wx:for="{{labourTypeList}}" wx:key="index">
{{item.name}}({{item.total}}) {{item.name}}({{item.total}})
</view> </view>
</view> </view>
<view class="video_ai_survey"> <view class="video_ai_survey">
<van-row> <van-row>
<van-col span="8"> <van-col span="8">
<view class="survey_content"> <view class="survey_content">
<view class="survey_content_img"> <view class="survey_content_img">
<image animation="{{animationData}}" src="{{labourImg}}" /> <image animation="{{animationData}}" src="{{labourImg}}" />
</view> </view>
</view> </view>
<view class="survey_content_number labour-survey_content_number"> <view class="survey_content_number labour-survey_content_number">
<view class="survey_content_value"> <view class="survey_content_value">
<text>{{ labourTotal }}</text> 人 <text>{{ labourTotal }}</text> 人
</view> </view>
</view> </view>
</van-col> </van-col>
<van-col span="16"> <van-col span="16">
<safety-bar-chart id="userChart" chart-id="userChart" data="{{labourData}}" height="350"></safety-bar-chart> <safety-bar-chart id="userChart" chart-id="userChart" data="{{labourData}}" height="350"></safety-bar-chart>
</van-col> </van-col>
</van-row> </van-row>
</view> </view>
</view> </view>
</view> </view>
<view class="echarts_max" wx:if="{{(subDeptUserInfo.subDeptType=='1' || subDeptUserInfo.subDeptType=='4' || subDeptUserInfo.subDeptType=='5') && subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='6' && subDeptUserInfo.userPost!='8'}}"> <view class="echarts_max"
<view class="echarts_min"> wx:if="{{(subDeptUserInfo.subDeptType=='1' || subDeptUserInfo.subDeptType=='4' || subDeptUserInfo.subDeptType=='5') && subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='6' && subDeptUserInfo.userPost!='8'}}">
<view class="eharts_title module_title_flex"> <view class="echarts_min">
今日出勤 <view class="eharts_title module_title_flex">
<!-- <view class="module_see_info" bindtap="goLWGL">查看详情 今日出勤
<!-- <view class="module_see_info" bindtap="goLWGL">查看详情
<van-icon name="arrow" /> <van-icon name="arrow" />
</view> --> </view> -->
</view> </view>
<view class="video_ai_survey"> <view class="video_ai_survey">
<van-row> <van-row>
<van-col span="8"> <van-col span="8">
<view class="survey_content"> <view class="survey_content">
<view class="survey_content_img"> <view class="survey_content_img">
<image animation="{{animationData}}" src="https://szgcwx.jhncidg.com/staticFiles/icon/dw.png" /> <image animation="{{animationData}}" src="https://szgcwx.jhncidg.com/staticFiles/icon/dw.png" />
</view> </view>
</view> </view>
<view class="survey_content_number labour-survey_content_number"> <view class="survey_content_number labour-survey_content_number">
<view class="survey_content_value"> <view class="survey_content_value">
<text>{{ labourDaysTotal }}</text> 人 <text>{{ labourDaysTotal }}</text> 人
</view> </view>
</view> </view>
</van-col> </van-col>
<van-col span="16"> <van-col span="16">
<safety-bar-chart id="attsChart" chart-id="attsChart" data="{{labourDays}}" height="350"></safety-bar-chart> <safety-bar-chart id="attsChart" chart-id="attsChart" data="{{labourDays}}" height="350"></safety-bar-chart>
</van-col> </van-col>
</van-row> </van-row>
</view> </view>
</view> </view>
</view> </view>
<view class="echarts_max bt30" wx:if="{{(subDeptUserInfo.subDeptType=='4' || subDeptUserInfo.subDeptType=='5') && subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='5' && subDeptUserInfo.userPost!='6' && subDeptUserInfo.userPost!='8'}}"> <view class="echarts_max bt30"
<view class="echarts_min"> wx:if="{{(subDeptUserInfo.subDeptType=='4' || subDeptUserInfo.subDeptType=='5') && subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='5' && subDeptUserInfo.userPost!='6' && subDeptUserInfo.userPost!='8'}}">
<view class="eharts_title module_title_flex"> <view class="echarts_min">
我的二维码 <view class="eharts_title module_title_flex">
</view> 我的二维码
<view class="video_ai_survey"> </view>
<van-row> <view class="video_ai_survey">
<van-col span="10" class="qrcode"> <van-row>
<image bindtap='showImg' data-set="{{subDeptUserInfo.qrCode}}" src="{{imgBaseUrl+subDeptUserInfo.qrCode}}"></image> <van-col span="10" class="qrcode">
</van-col> <image bindtap='showImg' data-set="{{subDeptUserInfo.qrCode}}" src="{{imgBaseUrl+subDeptUserInfo.qrCode}}">
<van-col span="14"> </image>
<view wx:if="{{subDeptUserInfo.userPost=='1'}}" class="qrtext"><text class="zz">项目经理 </text>扫描二维码登记信息,完成安全学习和在线考试,签署安全承诺书后可申请入场。</view> </van-col>
<view wx:if="{{subDeptUserInfo.userPost=='2'}}" class="qrtext"><text class="zz">班组组长 </text>扫描二维码登记信息,完成安全学习和在线考试,签署安全承诺书后可申请入场。</view> <van-col span="14">
<view wx:if="{{subDeptUserInfo.userPost=='3'}}" class="qrtext"><text class="zz">劳务人员 </text>扫描二维码登记信息,完成安全学习和在线考试,签署安全承诺书后可申请入场。</view> <view wx:if="{{subDeptUserInfo.userPost=='1'}}" class="qrtext"><text class="zz">项目经理
</van-col> </text>扫描二维码登记信息,完成安全学习和在线考试,签署安全承诺书后可申请入场。</view>
</van-row> <view wx:if="{{subDeptUserInfo.userPost=='2'}}" class="qrtext"><text class="zz">班组组长
</view> </text>扫描二维码登记信息,完成安全学习和在线考试,签署安全承诺书后可申请入场。</view>
</view> <view wx:if="{{subDeptUserInfo.userPost=='3'}}" class="qrtext"><text class="zz">劳务人员
</view> </text>扫描二维码登记信息,完成安全学习和在线考试,签署安全承诺书后可申请入场。</view>
</van-col>
</van-row>
</view>
</view>
</view>
<view class="echarts_max" wx:if="{{subDeptUserInfo.subDeptType=='1'}}"> <view class="echarts_max" wx:if="{{subDeptUserInfo.subDeptType=='1'}}">
<view class="echarts_min"> <view class="echarts_min">
<view class="eharts_title module_title_flex"> <view class="eharts_title module_title_flex">
最近出勤 最近出勤
<!-- <view class="module_see_info" bindtap="goZJCQ">查看详情 <!-- <view class="module_see_info" bindtap="goZJCQ">查看详情
<van-icon name="arrow" /> <van-icon name="arrow" />
</view> --> </view> -->
</view> </view>
<view class="video_ai_survey"> <view class="video_ai_survey">
<bar-chart id="chartBar" chartId="chartBar" chartData="{{labourDatas}}"></bar-chart> <bar-chart id="chartBar" chartId="chartBar" chartData="{{labourDatas}}"></bar-chart>
</view> </view>
</view> </view>
</view> </view>
<view class="echarts_max" wx:if="{{subDeptUserInfo.userPost=='4' || subDeptUserInfo.userPost=='5' || subDeptUserInfo.userPost=='6' || subDeptUserInfo.userPost=='8'}}"> <view class="echarts_max"
<view class="echarts_min"> wx:if="{{subDeptUserInfo.userPost=='4' || subDeptUserInfo.userPost=='5' || subDeptUserInfo.userPost=='6' || subDeptUserInfo.userPost=='8'}}">
<view class="eharts_title module_title_flex"> <view class="echarts_min">
最近出勤 <view class="eharts_title module_title_flex">
<!-- <view class="module_see_info" bindtap="goZJCQ">查看详情 最近出勤
<!-- <view class="module_see_info" bindtap="goZJCQ">查看详情
<van-icon name="arrow" /> <van-icon name="arrow" />
</view> --> </view> -->
</view> </view>
<view class="video_ai_survey"> <view class="video_ai_survey">
<view class="inspect_max_scroll"> <view class="inspect_max_scroll">
<view class="safety_prop module_title_flex summury"> <view class="safety_prop module_title_flex summury">
<text class="color_orange">默认展示近7天考勤数据</text> <text class="color_orange">默认展示近7天考勤数据</text>
</view> </view>
<view class="inspect_for_scroll" v-if="{{ attendanceListData.length>0 }}" wx:for="{{attendanceListData}}" wx:key="index"> <view class="inspect_for_scroll" v-if="{{ attendanceListData.length>0 }}" wx:for="{{attendanceListData}}"
<view class="inspect_for_bgd"> wx:key="index">
<view class="inspect_list_title"> <view class="inspect_for_bgd">
<view class="inspect_list_title_label inspect_list_title_width"> <view class="inspect_list_title">
<view class="inspect_list_title_number">{{index < 10 ?'0'+(index+1):(index+1)}}</view> <view class="inspect_list_title_label inspect_list_title_width">
<view class="module_title module_title_flex inspect_list_title_label">考勤时间:{{format.dateStrEv(item.inTime,item.outTime)}}</view> <view class="inspect_list_title_number">{{index < 10 ?'0'+(index+1):(index+1)}}</view>
</view> <view class="module_title module_title_flex inspect_list_title_label">
</view> 考勤时间:{{format.dateStrEv(item.inTime,item.outTime)}}</view>
<view class="inspect_list_info"> </view>
<view class="inspect_list_info_details"> </view>
<view class="inspect_list_info_img"> <view class="inspect_list_info">
<van-image wx:if="{{item.inPhoto}}" width="120rpx" height="120rpx" fit="cover" src="{{imgBaseUrl+item.inPhoto}}" /> <view class="inspect_list_info_details">
<van-image wx:else width="120rpx" height="120rpx" fit="cover" src="{{imgBaseUrl+item.outPhoto}}" /> <view class="inspect_list_info_img">
</view> <van-image wx:if="{{item.inPhoto}}" width="120rpx" height="120rpx" fit="cover"
<view class="inspect_list_info_data"> src="{{imgBaseUrl+item.inPhoto}}" />
<view class="inspect_list_info_data_prop color_blue">人员姓名:<text>{{item.userName}}</text></view> <van-image wx:else width="120rpx" height="120rpx" fit="cover"
<view class="inspect_list_info_data_prop">入场时间: src="{{imgBaseUrl+item.outPhoto}}" />
<text wx:if="{{item.inTime}}">{{format.timeStr(item.inTime)}}</text> </view>
<text wx:else class="color_red">未打卡</text> <view class="inspect_list_info_data">
</view> <view class="inspect_list_info_data_prop color_blue">人员姓名:<text>{{item.userName}}</text></view>
<view class="inspect_list_info_data_prop">离场时间: <view class="inspect_list_info_data_prop">入场时间:
<text wx:if="{{item.outTime}}">{{format.timeStr(item.outTime)}}</text> <text wx:if="{{item.inTime}}">{{format.timeStr(item.inTime)}}</text>
<text wx:else class="color_red">未打卡</text> <text wx:else class="color_red">未打卡</text>
</view> </view>
</view> <view class="inspect_list_info_data_prop">离场时间:
</view> <text wx:if="{{item.outTime}}">{{format.timeStr(item.outTime)}}</text>
<view class="inspect_list_info_position"> <text wx:else class="color_red">未打卡</text>
<text class="color_purple">单位名称:{{item.subDeptName}}</text> </view>
</view> </view>
</view> </view>
</view> <view class="inspect_list_info_position">
</view> <text class="color_purple">单位名称:{{item.subDeptName}}</text>
<view wx:if="{{attendanceListData.length==0}}"> </view>
<view style="padding-top: 5px;text-align: -webkit-center;"> </view>
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image> </view>
<view style="color: #a5abbb;">暂无数据</view> </view>
</view> <view wx:if="{{attendanceListData.length==0}}">
</view> <view style="padding-top: 5px;text-align: -webkit-center;">
</view> <image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;">
</view> </image>
</view> <view style="color: #a5abbb;">暂无数据</view>
</view> </view>
</view> </view>
</view>
</view>
</view>
</view>
</view>
<!-- 底部导航 --> <!-- 底部导航 -->
<van-tabbar wx:if="{{subDeptUserInfo.subDeptType=='1'}}" active="{{ active }}" bind:change="onChange" active-color="#ffffff" inactive-color="#7d95d6"> <van-tabbar wx:if="{{subDeptUserInfo.subDeptType=='1'}}" active="{{ active }}" bind:change="onChange"
<van-tabbar-item> active-color="#ffffff" inactive-color="#7d95d6">
<image slot="icon" src="/images/footer_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" /> <van-tabbar-item>
<image slot="icon-active" src="/images/foot_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" /> <image slot="icon" src="/images/footer_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
项目概况 <image slot="icon-active" src="/images/foot_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
</van-tabbar-item> 项目概况
</van-tabbar-item>
<van-tabbar-item bindtap="XMSP"> <van-tabbar-item bindtap="XMSP">
<image slot="icon" src="/images/footer_7.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" /> <image slot="icon" src="/images/footer_7.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_7.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" /> <image slot="icon-active" src="/images/foot_7.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
安全管理 安全管理
<span class="tabNum" wx:if="{{aqglDB>0}}">{{aqglDB}}</span> <span class="tabNum" wx:if="{{aqglDB>0}}">{{aqglDB}}</span>
</van-tabbar-item> </van-tabbar-item>
<van-tabbar-item bindtap="ZLGL"> <van-tabbar-item bindtap="ZLGL">
<image slot="icon" src="/images/footer_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" /> <image slot="icon" src="/images/footer_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" /> <image slot="icon-active" src="/images/foot_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
质量管理 质量管理
<span class="tabNum" wx:if="{{zlglDB>0}}">{{zlglDB}}</span> <span class="tabNum" wx:if="{{zlglDB>0}}">{{zlglDB}}</span>
</van-tabbar-item> </van-tabbar-item>
<van-tabbar-item bindtap="JDGL"> <van-tabbar-item bindtap="JDGL">
<image slot="icon" src="/images/footer_6.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" /> <image slot="icon" src="/images/footer_6.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_6.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" /> <image slot="icon-active" src="/images/foot_6.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
进度管理 进度管理
</van-tabbar-item> </van-tabbar-item>
<van-tabbar-item bindtap="XMGL"> <van-tabbar-item bindtap="XMGL">
<image slot="icon" src="/images/footer_1.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" /> <image slot="icon" src="/images/footer_1.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_1.png" mode="aspectFit" style="width:40rpx; height:40rpx;" /> <image slot="icon-active" src="/images/foot_1.png" mode="aspectFit" style="width:40rpx; height:40rpx;" />
项目管理 项目管理
<span class="tabNum" wx:if="{{todoDb>0}}">{{todoDb}}</span> <span class="tabNum" wx:if="{{todoDb>0}}">{{todoDb}}</span>
</van-tabbar-item> </van-tabbar-item>
</van-tabbar> </van-tabbar>
<!-- 底部导航 --> <!-- 底部导航 -->
<van-tabbar wx:if="{{(subDeptUserInfo.subDeptType=='4' || subDeptUserInfo.subDeptType=='5') && subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='5'}}" active="{{ active }}" bind:change="onChange" active-color="#ffffff" inactive-color="#7d95d6"> <van-tabbar
<van-tabbar-item> wx:if="{{(subDeptUserInfo.subDeptType=='4' || subDeptUserInfo.subDeptType=='5') && subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='5'}}"
<image slot="icon" src="/images/footer_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" /> active="{{ active }}" bind:change="onChange" active-color="#ffffff" inactive-color="#7d95d6">
<image slot="icon-active" src="/images/foot_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" /> <van-tabbar-item>
项目概况 <image slot="icon" src="/images/footer_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
</van-tabbar-item> <image slot="icon-active" src="/images/foot_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
项目概况
</van-tabbar-item>
<van-tabbar-item bindtap="XMGL"> <van-tabbar-item bindtap="XMGL">
<image slot="icon" src="/images/footer_1.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" /> <image slot="icon" src="/images/footer_1.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
<image slot="icon-active" src="/images/foot_1.png" mode="aspectFit" style="width:40rpx; height:40rpx;" /> <image slot="icon-active" src="/images/foot_1.png" mode="aspectFit" style="width:40rpx; height:40rpx;" />
项目管理 项目管理
<span class="tabNum" wx:if="{{todoDb>0}}">{{todoDb}}</span> <span class="tabNum" wx:if="{{todoDb>0}}">{{todoDb}}</span>
</van-tabbar-item> </van-tabbar-item>
</van-tabbar> </van-tabbar>

View File

@ -1,61 +1,62 @@
// pages/components/voucher-select/index.js // pages/components/voucher-select/index.js
import fmt from '../../../utils/date.js'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
width:{ width: {
type:String type: String
}, },
counts:{ counts: {
type:Number type: Number
}, },
placeholder:{ placeholder: {
type:String type: String
}, },
time:{ time: {
type:String type: String
}, },
maxDate:{ maxDate: {
type:Number, type: Number,
value:new Date().getTime() value: new Date().getTime()
}, },
value:{ value: {
type:String, type: String,
value:'' value: ''
}, },
currentDate:{ currentDate: {
type:Number type: Number
} }
}, },
/**数据监听 */ /**数据监听 */
observers: { observers: {
counts: function (val) { counts: function (val) {
this.setData({ this.setData({
item:val[0], item: val[0],
}) })
}, },
time:function(val){ time: function (val) {
var that = this var that = this
that.setData({ that.setData({
value:val, value: val,
// date:val // date:val
}) })
// that.onConfirm() // that.onConfirm()
} }
}, },
lifetimes: { lifetimes: {
created: function(){ created: function () {
//在组件实例刚刚被创建时执行,注意此时不能调用 setData //在组件实例刚刚被创建时执行,注意此时不能调用 setData
}, },
attached: function () { attached: function () {
//在组件实例进入页面节点树时执行 //在组件实例进入页面节点树时执行
}, },
ready: function () { ready: function () {
// 在组件在视图层布局完成后执行 // 在组件在视图层布局完成后执行
}, },
detached: function () { detached: function () {
// 在组件实例被从页面节点树移除时执行 // 在组件实例被从页面节点树移除时执行
}, },
}, },
@ -65,9 +66,10 @@ Component({
*/ */
data: { data: {
show: false, show: false,
date:'', date: '',
minDate: new Date(2022,1,1).getTime(), currDate: 0,
counts:'5', minDate: new Date(2022, 1, 1).getTime(),
counts: '5',
formatter(type, value) { formatter(type, value) {
if (type === 'year') { if (type === 'year') {
return `${value}`; return `${value}`;
@ -85,49 +87,52 @@ Component({
*/ */
methods: { methods: {
showPopup() { showPopup() {
this.setData({ debugger
show: true let cDate = this.properties.currentDate ? this.properties.currentDate : this.properties.value ? +fmt(this.properties.value) : +(new Date())
}); this.setData({
}, currDate: cDate,
onClose() { show: true
this.setData({ });
show: false },
}); onClose() {
}, this.setData({
onConfirm() { show: false
this.setData({ });
value: this.data.date },
}) onConfirm() {
this.setData({
value: this.data.date
})
this.triggerEvent('change', this.data.date) this.triggerEvent('change', this.data.date)
this.setData({ this.setData({
show: false show: false
}); });
}, },
formatter(type, value) { formatter(type, value) {
if (type === 'year') { if (type === 'year') {
return `${value}`; return `${value}`;
} }
if (type === 'month') { if (type === 'month') {
return `${value}`; return `${value}`;
} }
return value; return value;
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
onInput(event) { onInput(event) {
let date = new Date(event.detail) let date = new Date(event.detail)
let Y = date.getFullYear(); let Y = date.getFullYear();
let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1); let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ''; let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + '';
let H = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ''; let H = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + '';
let I = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ''; let I = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + '';
var lot = Y + '-' + M + '-' + D + ' ' + H + ':' + I +':00'; var lot = Y + '-' + M + '-' + D + ' ' + H + ':' + I + ':00';
this.setData({ this.setData({
date: lot, date: lot,
}); });
}, },
}, },

View File

@ -1,68 +1,24 @@
<!--pages/components/voucher-select/index.wxml--> <!--pages/components/voucher-select/index.wxml-->
<view class="voucher_select_max" bindtap="showPopup" style="width: {{width}};"> <view class="voucher_select_max" bindtap="showPopup" style="width: {{width}};">
<view class="voucher_select_min"> <view class="voucher_select_min">
<input class="celect_frame_min" placeholder="{{placeholder}}" placeholder-style="color:#6777aa;" value="{{value}}" disabled="true"/> <input class="celect_frame_min" placeholder="{{placeholder}}" placeholder-style="color:#6777aa;" value="{{value}}"
</view> disabled="true" />
<view class="voucher_select_icon"> </view>
<image src="../../../images/web_select_date.png"></image> <view class="voucher_select_icon">
</view> <image src="../../../images/web_select_date.png"></image>
</view>
</view> </view>
<van-popup show="{{ show }}" bind:close="onClose" position="bottom" custom-class="popup_style"> <van-popup show="{{ show }}" bind:close="onClose" position="bottom" custom-class="popup_style">
<view class="option_list_title"> <view class="option_list_title">
<view class="option_list_title_btn" bindtap="onClose">取消</view> <view class="option_list_title_btn" bindtap="onClose">取消</view>
<view>{{placeholder}}</view> <view>{{placeholder}}</view>
<view class="option_list_title_btn" bindtap="onConfirm">确认</view> <view class="option_list_title_btn" bindtap="onConfirm">确认</view>
</view> </view>
<van-datetime-picker type="datetime" show-toolbar="{{fales}}" value="{{ currDate }}" bind:input="onInput"
<van-datetime-picker min-date="{{ minDate }}" max-date="{{ maxDate }}" formatter="{{ formatter }}" visible-item-count="{{counts}}"
type="datetime" custom-class="time_select_style" column-class="time_list_style" active-class="time_active_style" />
show-toolbar="{{fales}}" <!-- <select-date-copy bindchange="onChangeDate" maxDate="{{maxDate}}" currentDate="{{newCurrentDate}}" counts="{{counts}}"></select-date-copy> -->
value="{{ currentDate }}"
bind:input="onInput"
min-date="{{ minDate }}"
max-date="{{ maxDate }}"
formatter="{{ formatter }}"
visible-item-count="{{counts}}"
custom-class="time_select_style"
column-class="time_list_style"
active-class="time_active_style"
/>
<!-- <select-date-copy bindchange="onChangeDate" maxDate="{{maxDate}}" currentDate="{{newCurrentDate}}" counts="{{counts}}"></select-date-copy> -->
</van-popup> </van-popup>

View File

@ -0,0 +1,2 @@
var moment = require('./moment.min.js');
export default moment;

View File

@ -3,36 +3,36 @@
* @param num * @param num
*/ */
function indexNumFormat(num) { function indexNumFormat(num) {
switch (num) { switch (num) {
case 0: case 0:
num = ""; num = "";
break; break;
case 1: case 1:
num = "Ⅱ"; num = "Ⅱ";
break; break;
case 2: case 2:
num = "Ⅲ"; num = "Ⅲ";
break; break;
case 3: case 3:
num = "Ⅳ"; num = "Ⅳ";
break; break;
case 4: case 4:
num = ""; num = "";
break; break;
case 5: case 5:
num = "Ⅵ"; num = "Ⅵ";
break; break;
case 6: case 6:
num = "Ⅶ"; num = "Ⅶ";
break; break;
case 7: case 7:
num = "Ⅷ"; num = "Ⅷ";
break; break;
case 8: case 8:
num = "Ⅸ"; num = "Ⅸ";
break; break;
} }
return num; return num;
} }
/** /**
@ -40,96 +40,96 @@ function indexNumFormat(num) {
* @param val * @param val
*/ */
function findDurationDate(val) { function findDurationDate(val) {
// 计算出相差天数 // 计算出相差天数
let days = Math.floor(val / (24 * 3600 * 1000)) let days = Math.floor(val / (24 * 3600 * 1000))
// 计算出小时数 // 计算出小时数
let leave1 = val % (24 * 3600 * 1000) // 计算天数后剩余的毫秒数 let leave1 = val % (24 * 3600 * 1000) // 计算天数后剩余的毫秒数
let hours = Math.floor(leave1 / (3600 * 1000)) let hours = Math.floor(leave1 / (3600 * 1000))
// 计算相差分钟数 // 计算相差分钟数
let leave2 = leave1 % (3600 * 1000) // 计算小时数后剩余的毫秒数 let leave2 = leave1 % (3600 * 1000) // 计算小时数后剩余的毫秒数
let minutes = Math.floor(leave2 / (60 * 1000)) let minutes = Math.floor(leave2 / (60 * 1000))
// 计算相差秒数 // 计算相差秒数
let leave3 = leave2 % (60 * 1000) // 计算分钟数后剩余的毫秒数 let leave3 = leave2 % (60 * 1000) // 计算分钟数后剩余的毫秒数
let seconds = Math.round(leave3 / 1000) let seconds = Math.round(leave3 / 1000)
if (days > 0) { if (days > 0) {
if (days < 10) days = "0" + days; if (days < 10) days = "0" + days;
if (hours < 10) hours = "0" + hours; if (hours < 10) hours = "0" + hours;
if (minutes < 10) minutes = "0" + minutes; if (minutes < 10) minutes = "0" + minutes;
if (seconds < 10) seconds = "0" + seconds; if (seconds < 10) seconds = "0" + seconds;
return days + '天' + hours + '小时' + minutes + '分钟' + seconds + '秒'; return days + '天' + hours + '小时' + minutes + '分钟' + seconds + '秒';
} }
if (hours > 0) { if (hours > 0) {
if (hours < 10) hours = "0" + hours; if (hours < 10) hours = "0" + hours;
if (minutes < 10) minutes = "0" + minutes; if (minutes < 10) minutes = "0" + minutes;
if (seconds < 10) seconds = "0" + seconds; if (seconds < 10) seconds = "0" + seconds;
return hours + '小时' + minutes + '分钟' + seconds + '秒'; return hours + '小时' + minutes + '分钟' + seconds + '秒';
} }
if (minutes > 0) { if (minutes > 0) {
if (minutes < 10) minutes = "0" + minutes; if (minutes < 10) minutes = "0" + minutes;
if (seconds < 10) seconds = "0" + seconds; if (seconds < 10) seconds = "0" + seconds;
return minutes + '分钟' + seconds + '秒'; return minutes + '分钟' + seconds + '秒';
} }
if (seconds > 0) { if (seconds > 0) {
if (seconds < 10) seconds = "0" + seconds; if (seconds < 10) seconds = "0" + seconds;
return seconds + '秒'; return seconds + '秒';
} }
} }
module.exports = { module.exports = {
indexNumFormat: indexNumFormat, indexNumFormat: indexNumFormat,
findDurationDate: findDurationDate, findDurationDate: findDurationDate,
split:function(str,sign){ split: function (str, sign) {
return str.split(sign); return str.split(sign);
}, },
parseStr:function(str){ parseStr: function (str) {
return JSON.parse(str); return JSON.parse(str);
}, },
evalStr:function(str){ evalStr: function (str) {
return eval(str); return eval(str);
}, },
dateStrEv:function(startDate,endDate){ dateStrEv: function (startDate, endDate) {
if(startDate){ if (startDate) {
return startDate.split(" ")[0]; return startDate.split(" ")[0];
}else if(endDate){ } else if (endDate) {
return endDate.split(" ")[0]; return endDate.split(" ")[0];
}else{ } else {
return "未找到记录"; return "未找到记录";
} }
}, },
dateStr:function(str){ dateStr: function (str) {
if(str){ if (str) {
return str.split(" ")[0]; return str.split(" ")[0];
}else{ } else {
return ""; return "";
} }
}, },
timeStr:function(str){ timeStr: function (str) {
return str.split(" ")[1]; return str.split(" ")[1];
}, },
isHttpImg:function(str){ isHttpImg: function (str) {
if(str.indexOf("http:")>-1 || str.indexOf("https:")>-1){ if (str.indexOf("http:") > -1 || str.indexOf("https:") > -1) {
return true; return true;
}else{ } else {
return false; return false;
} }
}, },
httpImg:function(str){ httpImg: function (str) {
if(str.indexOf("https:")>-1){ if (str.indexOf("https:") > -1) {
return str; return str;
}else{ } else {
return "https://xiangguan.sxyanzhu.com"+str; return "https://xiangguan.sxyanzhu.com" + str;
} }
}, },
birthDate:function(timestamp){ birthDate: function (timestamp) {
var date = getDate(parseInt(timestamp)); var date = getDate(parseInt(timestamp));
var mm = date.getMonth()+1; var mm = date.getMonth() + 1;
if(mm<10){ if (mm < 10) {
mm = '0'+mm; mm = '0' + mm;
} }
var dd = date.getDate(); var dd = date.getDate();
if(dd<10){ if (dd < 10) {
dd = '0'+dd; dd = '0' + dd;
} }
return date.getFullYear()+"-"+mm+"-"+dd; return date.getFullYear() + "-" + mm + "-" + dd;
} }
} }

File diff suppressed because one or more lines are too long