From 46d3620740d3dffee104171b3edf1ca6b92cece1 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期日, 17 三月 2024 18:11:12 +0800
Subject: [PATCH] ERP接口
---
h5/pages/visitorApplication/visitorApplication.vue | 27 ++++++++
h5/main.js | 4
admin/src/components/common/Tree.vue | 74 ++++++++++++++----------
h5/utils/utils.js | 14 ++++
admin/src/views/business/empower.vue | 14 +++-
admin/src/views/business/deletePersonnel.vue | 8 +-
admin/src/views/business/internalMember.vue | 2
7 files changed, 98 insertions(+), 45 deletions(-)
diff --git a/admin/src/components/common/Tree.vue b/admin/src/components/common/Tree.vue
index 432a1a6..795529d 100644
--- a/admin/src/components/common/Tree.vue
+++ b/admin/src/components/common/Tree.vue
@@ -2,13 +2,16 @@
<div class="tree">
<div v-for="(item, index) of list" :key="index" @click.stop="clickIten(item)">
<div class="tree_item">
- <i class="el-icon-caret-bottom" :class="{ 'activeColor': item[defaultProps.status] }" v-show="item[defaultProps.status] && item[defaultProps.children]"></i>
- <i class="el-icon-caret-right color" v-show="item[defaultProps.children] && !item[defaultProps.status]"></i>
- <div class="tree_item_label long-title-style" :title="item[defaultProps.name]" :class="{ 'activeColor': item[defaultProps.status] && !item[defaultProps.children] }">{{ item[defaultProps.name] }}</div>
+ <i class="el-icon-caret-bottom" :class="{ 'activeColor': item.fsStatus === 1 }" v-show="item.fsStatus === 1 && item.childList.length > 0"></i>
+ <i class="el-icon-caret-right color" v-show="item.childList.length > 0 && (item.fsStatus === 0 || !item.fsStatus)"></i>
+ <div class="tree_item_label long-title-style" :title="item.name" :class="{ 'activeColor': item.fsDate === 1 && item.childList.length === 0 }">{{ item.name }}</div>
+ <!-- <i class="el-icon-caret-bottom" :class="{ 'activeColor': item[defaultProps.status] }" v-show="item[defaultProps.status] && item[defaultProps.children]"></i>-->
+<!-- <i class="el-icon-caret-right color" v-show="item[defaultProps.children] && !item[defaultProps.status]"></i>-->
+<!-- <div class="tree_item_label long-title-style" :title="item[defaultProps.name]" :class="{ 'activeColor': item[defaultProps.status] && !item[defaultProps.children] }">{{ item[defaultProps.name] }}</div>-->
</div>
- <div class="tree_childern" v-show="item[defaultProps.status]">
+ <div class="tree_childern" v-show="item.fsStatus === 1">
<tree
- :list="item[defaultProps.children]"
+ :list="item.childList"
:defaultProps="defaultProps"
@callback="callback"
/>
@@ -36,7 +39,8 @@
name: 'name',
status: 'status',
children: 'children',
- id: 'id'
+ id: 'id',
+ erpId: 'erpId'
}
}
}
@@ -45,41 +49,51 @@
return {
tempItem: {
id: null,
- name: null
+ name: null,
+ erpId: null
}
}
},
methods: {
// 鐐瑰嚮褰撳墠椤�
clickIten (item) {
- item[this.defaultProps.status] = !item[this.defaultProps.status]
- this.list.forEach(subItem => {
- if ((subItem[this.defaultProps.id] !== item[this.defaultProps.id] && subItem[this.defaultProps.status]) || (this.list.length === 1 && subItem[this.defaultProps.status] === false)) {
- subItem[this.defaultProps.status] = false
- if (subItem[this.defaultProps.children]) {
- this.recursion(subItem[this.defaultProps.children])
- }
- }
- })
- if (this.tempItem['id'] === item[this.defaultProps.id]) {
- this.tempItem = {
- id: null,
- name: null
- }
- } else {
- this.tempItem.id = item[this.defaultProps.id]
- this.tempItem.name = item[this.defaultProps.name]
+ // item[this.defaultProps.status] = !item[this.defaultProps.status]
+ // this.list.forEach(subItem => {
+ // if ((subItem[this.defaultProps.id] !== item[this.defaultProps.id] && subItem[this.defaultProps.status]) || (this.list.length === 1 && subItem[this.defaultProps.status] === false)) {
+ // subItem[this.defaultProps.status] = false
+ // if (subItem[this.defaultProps.children]) {
+ // this.recursion(subItem[this.defaultProps.children])
+ // }
+ // }
+ // })
+ // if (this.tempItem['id'] === item[this.defaultProps.id]) {
+ // this.tempItem = {
+ // id: null,
+ // name: null,
+ // erpId: null
+ // }
+ // } else {
+ // this.tempItem.id = item[this.defaultProps.id]
+ // this.tempItem.name = item[this.defaultProps.name]
+ // this.tempItem.erpId = item['erpId']
+ // }
+ item.fsDate === 0 || !item.fsDate ? item.fsDate = 1 : item.fsDate = 0
+ if (item.childList.length > 0) {
+ item.fsStatus === 0 || !item.fsStatus ? item.fsStatus = 1 : item.fsStatus = 0
}
-
- this.$emit('callback', this.tempItem, item)
+ this.$emit('callback', item, item)
},
// 閫掑綊鏂规硶
recursion (children) {
children.forEach(item => {
- item[this.defaultProps.status] = false
- if (item[this.defaultProps.children]) {
- this.recursion(item[this.defaultProps.children])
+ item.fsDate = 0
+ if (item.childList.length > 0) {
+ this.recursion(item.childList)
}
+ // item[this.defaultProps.status] = false
+ // if (item[this.defaultProps.children]) {
+ // this.recursion(item[this.defaultProps.children])
+ // }
})
},
callback (data, item) {
@@ -89,7 +103,7 @@
this.tempItem.id = data.id
this.tempItem.name = data.name
}
- this.$emit('callback', this.tempItem, item)
+ this.$emit('callback', data, item)
}
}
}
diff --git a/admin/src/views/business/deletePersonnel.vue b/admin/src/views/business/deletePersonnel.vue
index c933e02..563c32e 100644
--- a/admin/src/views/business/deletePersonnel.vue
+++ b/admin/src/views/business/deletePersonnel.vue
@@ -3,10 +3,10 @@
<!-- 鎼滅储琛ㄥ崟 -->
<el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
<el-form-item label="濮撳悕" prop="name">
- <el-input v-model="searchForm.name" placeholder="璇疯緭鍏ヨ瀹㈠悕绉�" @keypress.enter.native="search"></el-input>
+ <el-input v-model="searchForm.name" placeholder="璇疯緭鍏ュ鍚�" @keypress.enter.native="search"></el-input>
</el-form-item>
- <el-form-item label="鍏徃鍚嶇О" prop="companyName">
- <el-input v-model="searchForm.companyName" placeholder="璇疯緭鍏ュ叕鍙稿悕绉�" @keypress.enter.native="search"></el-input>
+ <el-form-item label="缁勭粐鍚嶇О" prop="companyName">
+ <el-input v-model="searchForm.companyName" placeholder="璇疯緭鍏ョ粍缁囧悕绉�" @keypress.enter.native="search"></el-input>
</el-form-item>
<section>
<el-button type="primary" @click="search">鎼滅储</el-button>
@@ -27,7 +27,7 @@
<!-- <el-table-column type="selection" width="55"></el-table-column>-->
<el-table-column prop="name" label="濮撳悕" min-width="100px"></el-table-column>
<el-table-column prop="phone" label="鎵嬫満鍙�" min-width="100px"></el-table-column>
- <el-table-column prop="companyName" label="鍏徃" min-width="100px"></el-table-column>
+ <el-table-column prop="companyName" label="缁勭粐鍚嶇О" min-width="100px"></el-table-column>
<el-table-column label="鐢ㄦ埛绫诲瀷" min-width="100px">
<template slot-scope="{row}">
<span v-if="row.type === 0">鍔冲姟璁垮</span>
diff --git a/admin/src/views/business/empower.vue b/admin/src/views/business/empower.vue
index b0e7e3d..ef8133b 100644
--- a/admin/src/views/business/empower.vue
+++ b/admin/src/views/business/empower.vue
@@ -71,6 +71,12 @@
</template>
</el-table-column>
<el-table-column prop="sendDate" label="鍒涘缓鏃堕棿" min-width="150px"></el-table-column>
+ <el-table-column label="鏄惁鍒犻櫎" min-width="100px">
+ <template slot-scope="{row}">
+ <span style="color: green;" v-if="row.isdeleted === 0">鍚�</span>
+ <span style="color: red;" v-if="row.isdeleted === 1">鏄�</span>
+ </template>
+ </el-table-column>
<!-- <el-table-column prop="createrName" label="鎿嶄綔浜哄憳" min-width="100px"></el-table-column>-->
<el-table-column label="涓嬪彂鐘舵��" min-width="100px">
<template slot-scope="{row}">
@@ -163,11 +169,9 @@
},
reset () {
this.$refs.searchForm.resetFields()
- this.searchForm.startTime = ''
- this.searchForm.endTime = ''
- this.time = []
- this.searchForm.radio = null
- this.search()
+ this.searchForm.radio = '0'
+ this.changeRadio('0')
+ // this.search()
}
}
}
diff --git a/admin/src/views/business/internalMember.vue b/admin/src/views/business/internalMember.vue
index e776e64..8fc5abb 100644
--- a/admin/src/views/business/internalMember.vue
+++ b/admin/src/views/business/internalMember.vue
@@ -39,7 +39,7 @@
<template v-slot:menu>
<div style="width: 100%; height: 50px; background: rgba(242, 242, 242, 1); line-height: 50px; text-align: center; font-size: 14px;">浼佷笟缁勭粐鏋舵瀯</div>
<div style="width: 100%; height: calc(100vh - 170px); overflow-y: scroll;">
- <Tree :list="companyTree" :defaultProps="{name: 'name', status: 'status', children: 'childList', id: 'id',erpId:'erpId'}" @callback="callback" />
+ <Tree :list="companyTree" :defaultProps="{name: 'name', status: 'fsStatus', children: 'childList', id: 'id'}" @callback="callback" />
</div>
</template>
<!-- 琛ㄦ牸鍜屽垎椤� -->
diff --git a/h5/main.js b/h5/main.js
index 0990e1e..3cd2df4 100644
--- a/h5/main.js
+++ b/h5/main.js
@@ -7,9 +7,9 @@
Vue.config.productionTip = false
-// Vue.prototype.$baseUrl = 'http://192.168.0.186:10027/';
+Vue.prototype.$baseUrl = 'http://192.168.0.111:10027/';
// Vue.prototype.$baseUrl = 'https://dmtest.ahapp.net/h5_api/';
-Vue.prototype.$baseUrl = 'http://facepay.huasunsolar.com/web_interface/';
+// Vue.prototype.$baseUrl = 'http://facepay.huasunsolar.com/web_interface/';
Vue.prototype.$store = store;
App.mpType = 'app'
diff --git a/h5/pages/visitorApplication/visitorApplication.vue b/h5/pages/visitorApplication/visitorApplication.vue
index 927e769..bdf5b0a 100644
--- a/h5/pages/visitorApplication/visitorApplication.vue
+++ b/h5/pages/visitorApplication/visitorApplication.vue
@@ -35,7 +35,7 @@
<text>绂诲巶鏃堕棿</text>
<text>*</text>
</view>
- <view class="list_item_content" @click="show5 = true">
+ <view class="list_item_content" @click="openLC">
<text :style="{color: form1.endtime ? '#000000' : ''}">{{form1.endtime ? form1.endtime : '璇烽�夋嫨'}}</text>
<u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
</view>
@@ -105,8 +105,10 @@
></u-datetime-picker>
<!-- 绂诲満鏃堕棿 -->
<u-datetime-picker
+ v-if="form1.starttime"
:show="show5"
- :minDate="new Date().getTime()"
+ :minDate="new Date(form1.starttime).getTime()"
+ :maxDate="new Date(maxTime).getTime()"
mode="datetime"
@cancel="show5 = false"
@confirm="setoutDate"
@@ -291,6 +293,7 @@
import tlyPictureCut from "@/components/tly-picture-cut/tlyPictureCut.vue";
import keyboardInput from "@/components/keyboard-input/keyboard-input.vue";
import QfImageCropper from '@/uni_modules/qf-image-cropper/components/qf-image-cropper/qf-image-cropper.vue';
+ import { getDaysAfterDate } from '@/utils/utils.js'
export default {
data() {
return {
@@ -309,6 +312,8 @@
columns1: [[{name: '韬唤璇�', id: 0}, {name: '娓境璇佷欢', id: 1},{name: '鎶ょ収', id: 2}]],
columns: [],
cars: [],
+ day: null,
+ maxTime: '',
carName: '',
personnel: [],
userAnswerId: '',
@@ -443,6 +448,16 @@
}).then(res => {
if (res.code === 200) {
this.visit = res.data.code
+ }
+ })
+ // 璧峰鏃堕棿鏃堕暱
+ this.$u.api.getSystemDictData({
+ dictCode: 'VISIT_CONFIG',
+ label: 'VALIDATE_VISIT'
+ }).then(res => {
+ if (res.code === 200) {
+ this.day = Number(res.data.code)
+ // console.log(nextDay('after', true, this.day))
}
})
},
@@ -588,8 +603,16 @@
}
})
},
+ openLC() {
+ if (!this.form1.starttime) return uni.showToast({
+ title: '璇峰厛閫夋嫨鍏ュ巶鏃堕棿',
+ icon: 'none'
+ })
+ this.show5 = true
+ },
setinDate(e) {
this.form1.starttime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM');
+ this.maxTime = getDaysAfterDate(uni.$u.timeFormat(e.value, 'yyyy-mm-dd'), this.day)
this.show4 = false
},
setoutDate(e) {
diff --git a/h5/utils/utils.js b/h5/utils/utils.js
index a499c7f..5c30af7 100644
--- a/h5/utils/utils.js
+++ b/h5/utils/utils.js
@@ -50,6 +50,18 @@
let d2 = Date.parse(new Date(endDdate));
// 鏃堕棿鎴崇浉鍑� / 澶╂暟
let day = parseInt((d2 - d1) / (1000 * 60 * 60 * 24));
- console.log(day)
return day
+}
+
+// 鑾峰彇澶氬皯澶╁悗鐨勬棩鏈�
+export const getDaysAfterDate = (date, days) => {
+ if (days === 0) {
+ return '2099-01-01'
+ }
+ const now = new Date(date);
+ now.setDate(now.getDate() + days);
+ const year = now.getFullYear();
+ const month = now.getMonth() + 1; // 鏈堜唤鏄粠0寮�濮嬬殑
+ const day = now.getDate();
+ return `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
}
\ No newline at end of file
--
Gitblit v1.9.3