k94314517
2024-03-17 46d3620740d3dffee104171b3edf1ca6b92cece1
ERP接口
已修改7个文件
143 ■■■■■ 文件已修改
admin/src/components/common/Tree.vue 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/business/deletePersonnel.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/business/empower.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/business/internalMember.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/main.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/pages/visitorApplication/visitorApplication.vue 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/utils/utils.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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)
    }
  }
}
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>
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()
    }
  }
}
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>
        <!-- 表格和分页 -->
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'
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) {
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')}`;
}