spring
2025-03-04 648520268c8878cd839e8560dc67af2c6e4d97cd
修改文件管理bug
已修改9个文件
2174 ■■■■ 文件已修改
src/assets/styles/index.scss 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Table/value-table.vue 2047 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/materialOrder/dataLookVisible.vue 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/rawMaterialInspection/dataLookVisible.vue 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/systemManagement/documentControl/components/DistributionCollectionRecord.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/systemManagement/documentControl/components/FileChangeRequest.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/systemManagement/documentControl/index.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/systemManagement/documentRecords/approvalRecord.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/systemManagement/documentRecords/regularReviewsRecord.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/styles/index.scss
@@ -1,16 +1,17 @@
@import './variables.scss';
@import './mixin.scss';
@import './transition.scss';
@import './element-ui.scss';
@import './sidebar.scss';
@import './btn.scss';
@import "./variables.scss";
@import "./mixin.scss";
@import "./transition.scss";
@import "./element-ui.scss";
@import "./sidebar.scss";
@import "./btn.scss";
body {
  height: 100%;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
  font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB,
    Microsoft YaHei, Arial, sans-serif;
}
label {
@@ -104,7 +105,8 @@
  display: block;
  line-height: 32px;
  font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  color: #2c3e50;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
@@ -134,7 +136,7 @@
}
.text-center {
  text-align: center
  text-align: center;
}
.sub-navbar {
@@ -145,7 +147,13 @@
  text-align: right;
  padding-right: 20px;
  transition: 600ms ease position;
  background: linear-gradient(90deg, rgba(32, 182, 249, 1) 0%, rgba(32, 182, 249, 1) 0%, rgba(33, 120, 241, 1) 100%, rgba(33, 120, 241, 1) 100%);
  background: linear-gradient(
    90deg,
    rgba(32, 182, 249, 1) 0%,
    rgba(32, 182, 249, 1) 0%,
    rgba(33, 120, 241, 1) 100%,
    rgba(33, 120, 241, 1) 100%
  );
  .subtitle {
    font-size: 20px;
@@ -180,3 +188,11 @@
    margin-bottom: 10px;
  }
}
table {
  border-collapse: collapse; /* 关键属性:合并边框 */
}
.required-span {
  color: red;
}
src/components/Table/value-table.vue
@@ -1,242 +1,247 @@
<style scoped>
  .value-table {
    width: 100%;
    height: 100%;
    overflow-y: auto;
  }
.value-table {
  width: 100%;
  height: 100%;
  overflow-y: auto;
}
  .table {
    width: 100%;
    height: calc(100% - 42px);
  }
.table {
  width: 100%;
  height: calc(100% - 42px);
}
  .page {
    width: 100%;
    height: 30px;
    text-align: right;
    margin-top: 10px;
  }
.page {
  width: 100%;
  height: 30px;
  text-align: right;
  margin-top: 10px;
}
  .down-left {
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
.down-left {
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
  .down-right {
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
.down-right {
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
  .body {
    overflow-x: hidden;
  }
.body {
  overflow-x: hidden;
}
  .handleBtn {
    border: none;
    padding: 0;
    color: #409EFF;
    background: transparent;
  }
.handleBtn {
  border: none;
  padding: 0;
  color: #409EFF;
  background: transparent;
}
  .handleBtn:hover {
    background: transparent;
  }
.handleBtn:hover {
  background: transparent;
}
  .handleBtn.is-disabled {
    color: #C0C4CC;
  }
  .red{
    color: red !important;
  }
  >>>.el-loading-parent--relative {
    z-index: 1 !important;
  }
  >>> .el-table__body-wrapper::-webkit-scrollbar {
    height: 14px; /* 设置滚动条宽度 */
  }
.handleBtn.is-disabled {
  color: #C0C4CC;
}
.red {
  color: red !important;
}
>>>.el-loading-parent--relative {
  z-index: 1 !important;
}
>>>.el-table__body-wrapper::-webkit-scrollbar {
  height: 14px;
  /* 设置滚动条宽度 */
}
</style>
<style>
  /* .value-table .highlight-warning-row-border td {
/* .value-table .highlight-warning-row-border td {
        border-top: 2px solid #ffcd29;
        border-bottom: 2px solid #ffcd29;
    } */
  .value-table .highlight-warning-row-border td:first-child {
    border-left: 4px solid #ffcd29;
  }
.value-table .highlight-warning-row-border td:first-child {
  border-left: 4px solid #ffcd29;
}
  .value-table .highlight-warning-row-border td:last-child {
    border-right: 4px solid #ffcd29;
  }
.value-table .highlight-warning-row-border td:last-child {
  border-right: 4px solid #ffcd29;
}
  /* .value-table .highlight-danger-row-border td {
/* .value-table .highlight-danger-row-border td {
        border-top: 2px solid red;
        border-bottom: 2px solid red;
    } */
  .value-table .highlight-danger-row-border td:first-child {
    border-left: 4px solid #f56c6c;
  }
.value-table .highlight-danger-row-border td:first-child {
  border-left: 4px solid #f56c6c;
}
  .value-table .highlight-danger-row-border td:last-child {
    border-right: 4px solid #f56c6c;
  }
.value-table .highlight-danger-row-border td:last-child {
  border-right: 4px solid #f56c6c;
}
  .value-table .el-upload {
    width: 100%;
  }
.value-table .el-upload {
  width: 100%;
}
  .value-table .el-upload-dragger {
    width: 100%;
  }
.value-table .el-upload-dragger {
  width: 100%;
}
  .value-table .handleBtn.is-disabled .el-upload:focus {
    color: #C0C4CC !important;
  }
.value-table .handleBtn.is-disabled .el-upload:focus {
  color: #C0C4CC !important;
}
  .value-table .avatar-uploader .el-upload {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .el-table__empty-text{
    text-align: left;
    width: 100%;
    display: inline-block;
    margin-left: 200px;
  }
.value-table .avatar-uploader .el-upload {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.el-table__empty-text {
  text-align: left;
  width: 100%;
  display: inline-block;
  margin-left: 200px;
}
</style>
<template>
  <div class="value-table">
    <div :style="data.isPage!=undefined&&data.isPage!=true?'height:100%':''" class="table">
      <el-table :key="specialKey" ref="eltable" v-loading="loading" :current-row-key="data.currentId" :data="tableData" :highlight-current-row="data.highlight===undefined||data.highlight"
        :row-class-name="tableRowClassName" :row-key="record=>record[rowKey]" :show-summary="data.countFleid!=undefined && data.countFleid.length > 0" :span-method="spanMethod"
        :summary-method="getSummaries"
        height="100%" style="width: 100%;" tooltip-effect="dark"
        @select="select" @selection-change="selectChange"
        @sort-change="sortChange" @row-click="rowClick">
    <div :style="data.isPage != undefined && data.isPage != true ? 'height:100%' : ''" class="table">
      <el-table :key="specialKey" ref="eltable" v-loading="loading" :current-row-key="data.currentId" :data="tableData"
        :highlight-current-row="data.highlight === undefined || data.highlight" :row-class-name="tableRowClassName"
        :row-key="record => record[rowKey]" :show-summary="data.countFleid != undefined && data.countFleid.length > 0"
        :span-method="spanMethod" :summary-method="getSummaries" height="100%" style="width: 100%;"
        tooltip-effect="dark" @select="select" @selection-change="selectChange" @sort-change="sortChange"
        @row-click="rowClick">
        <el-table-column v-if="data.showSelect" :key="Math.random()" :width="selectionWidth" type="selection">
        </el-table-column>
        <el-table-column v-if="data.isIndex" :key="Math.random()" :width="selectionWidth" align="center" label="序号" type="index">
        <el-table-column v-if="data.isIndex" :key="Math.random()" :width="selectionWidth" align="center" label="序号"
          type="index">
        </el-table-column>
        <el-table-column v-for="(a, ai) in tableHead" v-if="!data.headNoShow||(data.headNoShow&&data.headNoShow.length==0)||(data.headNoShow&&data.headNoShow.length>0&&!data.headNoShow.find(d=>d==a.label))" :key="ai+'bbbbb'" :isColumnWidth="isColumnWidth" :isShowZero="isShowZero"
          :label="a.value" :min-width="columnMinWidth" :prop="a.label" :sortable="a.sort === 'custom' ? 'custom' : false" show-overflow-tooltip>
        <el-table-column v-for="(a, ai) in tableHead"
          v-if="!data.headNoShow || (data.headNoShow && data.headNoShow.length == 0) || (data.headNoShow && data.headNoShow.length > 0 && !data.headNoShow.find(d => d == a.label))"
          :key="ai + 'bbbbb'" :isColumnWidth="isColumnWidth" :isShowZero="isShowZero" :label="a.value"
          :min-width="columnMinWidth" :prop="a.label" :sortable="a.sort === 'custom' ? 'custom' : false"
          show-overflow-tooltip>
          <template slot-scope="scope">
            <div v-if="showType(a.label, data.tagField) != null">
              <template v-if="typeof(scope.row[a.label]) == 'object'">
              <template v-if="typeof (scope.row[a.label]) == 'object'">
                <template v-for="(param, i) in scope.row[a.label]">
                  <el-tag v-for="(b, bi) in data.tagField[a.label].select" v-if="b.value == param" :key="bi+'cccc'"
                    :type="b.type" size="medium" style="margin-right: 5px;">{{b.label}}</el-tag>
                  <el-tag v-for="(b, bi) in data.tagField[a.label].select" v-if="b.value == param" :key="bi + 'cccc'"
                    :type="b.type" size="medium" style="margin-right: 5px;">{{ b.label }}</el-tag>
                </template>
              </template>
              <template v-else>
                <el-tag v-for="(b, bi) in data.tagField[a.label].select" v-show="b.value == scope.row[a.label]" :key="bi+'ddddd'"
                  :type="b.type" size="medium">{{b.label}}</el-tag>
                <el-tag v-for="(b, bi) in data.tagField[a.label].select" v-show="b.value == scope.row[a.label]"
                  :key="bi + 'ddddd'" :type="b.type" size="medium">{{ b.label }}</el-tag>
              </template>
            </div>
            <!-- 可操作行进行点击事件 -->
            <span v-else-if="data.linkEvent&&showLink(a.label, data.linkEvent)" style="color:#409EFF;cursor: pointer;"
              @click="handleLinkEvent(scope.row,data.linkEvent[a.label])">{{scope.row[a.label]}}</span>
            <img v-else-if="showUpload(a.label)&&scope.row[a.label]" :src="javaApi+'/img/'+scope.row[a.label]"
              alt="" style="width: 40px;height: 40px;margin-top: 10px;">
            <span v-else :class="{red:getRedColor(a.label,scope.row)}" >{{scope.row[a.label]}}</span>
            <span v-else-if="data.linkEvent && showLink(a.label, data.linkEvent)" style="color:#409EFF;cursor: pointer;"
              @click="handleLinkEvent(scope.row, data.linkEvent[a.label])">{{ scope.row[a.label] }}</span>
            <img v-else-if="showUpload(a.label) && scope.row[a.label]" :src="javaApi + '/img/' + scope.row[a.label]" alt=""
              style="width: 40px;height: 40px;margin-top: 10px;">
            <span v-else :class="{ red: getRedColor(a.label, scope.row) }">{{ scope.row[a.label] }}</span>
          </template>
        </el-table-column>
        <el-table-column v-if="data.do.length > 0" :width="getWidth()" align="center" fixed="right" label="操作">
          <template slot-scope="scope">
            <el-button v-for="(a, ai) in data.do" :key="ai
            +'qqqq'" :disabled="a.disabFun ? a.disabFun(scope.row,scope.$index) : false"
              :type="a.type" class="handleBtn"
              @click="main(scope.row, a)">
              <span v-if="a.type!='upload'">{{a.font}}</span>
              <el-upload v-else ref='upload'
                :accept='a.uploadConfig.accept' :action="javaApi+a.uploadConfig.url+'?id='+ (a.uploadConfig.uploadIdFun ? a.uploadConfig.uploadIdFun(scope.row) :  scope.row.id)"
                :disabled="a.disabFun ? a.disabFun(scope.row,scope.$index) : false" :headers="token" :on-error="onError" :on-success="handleSuccessUp" :show-file-list="false"
                name="file" style="background: transparent;">
                <span>{{a.font}}</span>
              + 'qqqq'" :disabled="a.disabled ? a.disabled(scope.row, scope.$index) : false" :type="a.type"
              class="handleBtn" @click="main(scope.row, a)">
              <span v-if="a.type != 'upload'">{{ a.font }}</span>
              <el-upload v-else ref='upload' :accept='a.uploadConfig.accept'
                :action="javaApi + a.uploadConfig.url + '?id=' + (a.uploadConfig.uploadIdFun ? a.uploadConfig.uploadIdFun(scope.row) : scope.row.id)"
                :disabled="a.disabled ? a.disabled(scope.row, scope.$index) : false" :headers="token" :on-error="onError"
                :on-success="handleSuccessUp" :show-file-list="false" name="file" style="background: transparent;">
                <span>{{ a.font }}</span>
              </el-upload>
            </el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div v-if="data.isPage==undefined||data.isPage" class="page">
    <div v-if="data.isPage == undefined || data.isPage" class="page">
      <el-pagination :current-page="page.current" :page-size="page.size" :page-sizes="[10, 20, 30, 50, 100]"
        :total="total" layout="total, sizes, prev, pager, next, jumper" @size-change="sizeChange"
        @current-change="currentChange">
      </el-pagination>
    </div>
    <el-dialog :close-on-click-modal="false" :visible.sync="upDia"
               :width="data.row==1?'500px':540+data.row * 200 + 'px'"
               append-to-body title="编辑">
      :width="data.row == 1 ? '500px' : 540 + data.row * 200 + 'px'" append-to-body title="编辑">
      <div class="body" style="max-height: 600px;overflow-y: auto;padding: 5px 10px 5px 0;">
        <div v-if="data.row > 1">
          <div v-for="(a, ai) in upHead" :key="ai+'ffff'" style="line-height: 50px;">
            <el-col :offset="1" :span="6/data.row" style="text-align: right;">
              <span v-if="showUpReq(a.label)" class="required-span">* </span>{{a.value}}:
          <div v-for="(a, ai) in upHead" :key="ai + 'ffff'" style="line-height: 50px;">
            <el-col :offset="1" :span="6 / data.row" style="text-align: right;">
              <span v-if="showUpReq(a.label)" class="required-span">* </span>{{ a.value }}:
            </el-col>
            <el-col :span="16/data.row">
              <el-input v-if="showType(a.label, data.selectField) == null&&!showUpload(a.label)&&!showCascader(a.label)" v-model="upData[a.label]" :disabled="isDisabled(a.label)" :placeholder="`请输入${a.value}`"
                clearable
            <el-col :span="16 / data.row">
              <el-input v-if="showType(a.label, data.selectField) == null && !showUpload(a.label) && !showCascader(a.label)"
                v-model="upData[a.label]" :disabled="isDisabled(a.label)" :placeholder="`请输入${a.value}`" clearable
                size="small"></el-input>
              <el-select v-if="showType(a.label, data.selectField) != null" v-model="upData[a.label]" :allow-create="data.selectField[a.label].allowCreate"
                         :default-first-option="data.selectField[a.label].defaultFirstOption"
                         :disabled="isDisabled(a.label)"
                :multiple="data.selectField[a.label].choose" clearable filterable
                size="small" style="width: 100%;">
                <el-option v-for="(b, bi) in data.selectField[a.label].select" :key="bi+'eeeee'" :label="b.label"
              <el-select v-if="showType(a.label, data.selectField) != null" v-model="upData[a.label]"
                :allow-create="data.selectField[a.label].allowCreate"
                :default-first-option="data.selectField[a.label].defaultFirstOption" :disabled="isDisabled(a.label)"
                :multiple="data.selectField[a.label].choose" clearable filterable size="small" style="width: 100%;">
                <el-option v-for="(b, bi) in data.selectField[a.label].select" :key="bi + 'eeeee'" :label="b.label"
                  :value="b.value">
                </el-option>
              </el-select>
              <el-upload v-if="showUpload(a.label)" ref='upload'
                :accept='data.addUploadConfig.accept' :action="javaApi+data.addUploadConfig.url" :headers="token" :multiple="false"
                :on-error="onError" :on-success="m=>handleSuccessUp(m, a.label)" :show-file-list="false" class="avatar-uploader"
                name="file"
              <el-upload v-if="showUpload(a.label)" ref='upload' :accept='data.addUploadConfig.accept'
                :action="javaApi + data.addUploadConfig.url" :headers="token" :multiple="false" :on-error="onError"
                :on-success="m => handleSuccessUp(m, a.label)" :show-file-list="false" class="avatar-uploader" name="file"
                style="background: transparent;width: 80px;height: 80px;border: 1px solid #DCDFE6;border-radius: 6px;margin: 10px 0;">
                <img v-if="upData[a.label]" :src="javaApi+'/img/'+upData[a.label]" class="avatar"
                <img v-if="upData[a.label]" :src="javaApi + '/img/' + upData[a.label]" class="avatar"
                  style="width: 80px;height: 80px;border-radius: 6px;">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
              <el-cascader v-if="showCascader(a.label)" :options="data.cascaderField[a.label].tree" :placeholder="`请选择${a.value}`"
                :props="data.cascaderField.props" :show-all-levels="false" :value="upData[a.label]"
                clearable filterable size="small"
                style="width: 100%;" @change="m=>handleCascader(m,a.label)"></el-cascader>
              <el-cascader v-if="showCascader(a.label)" :options="data.cascaderField[a.label].tree"
                :placeholder="`请选择${a.value}`" :props="data.cascaderField.props" :show-all-levels="false"
                :value="upData[a.label]" clearable filterable size="small" style="width: 100%;"
                @change="m => handleCascader(m, a.label)"></el-cascader>
            </el-col>
          </div>
        </div>
        <div v-else>
          <el-row v-for="(a, ai) in upHead" :key="ai+'ggggg'" style="line-height: 50px;">
          <el-row v-for="(a, ai) in upHead" :key="ai + 'ggggg'" style="line-height: 50px;">
            <el-col :span="6" style="text-align: right;">
              <span v-if="showUpReq(a.label)" class="required-span">* </span>{{a.value}}:
              <span v-if="showUpReq(a.label)" class="required-span">* </span>{{ a.value }}:
            </el-col>
            <el-col :offset="1" :span="16">
              <el-input v-if="showType(a.label, data.selectField) == null&&!showUpload(a.label)&&!showCascader(a.label)" v-model="upData[a.label]" :disabled="isDisabled(a.label)" :placeholder="`请输入${a.value}`"
                clearable
              <el-input v-if="showType(a.label, data.selectField) == null && !showUpload(a.label) && !showCascader(a.label)"
                v-model="upData[a.label]" :disabled="isDisabled(a.label)" :placeholder="`请输入${a.value}`" clearable
                size="small"></el-input>
              <el-select v-if="showType(a.label, data.selectField) != null" v-model="upData[a.label]" :disabled="isDisabled(a.label)"
                :multiple="data.selectField[a.label].choose" clearable filterable
              <el-select v-if="showType(a.label, data.selectField) != null" v-model="upData[a.label]"
                :disabled="isDisabled(a.label)" :multiple="data.selectField[a.label].choose" clearable filterable
                size="small" style="width: 100%;">
                <el-option v-for="(b, bi) in data.selectField[a.label].select" :key="bi+'fffff'" :label="b.label"
                <el-option v-for="(b, bi) in data.selectField[a.label].select" :key="bi + 'fffff'" :label="b.label"
                  :value="b.value"></el-option>
              </el-select>
              <el-upload v-if="showUpload(a.label)" ref='upload' :accept='data.addUploadConfig.accept'
                :action="javaApi+data.addUploadConfig.url" :headers="token" :multiple="false" :on-error="onError"
                :on-success="m=>handleSuccessUp(m, a.label)" :show-file-list="false" class="avatar-uploader" name="file"
                :action="javaApi + data.addUploadConfig.url" :headers="token" :multiple="false" :on-error="onError"
                :on-success="m => handleSuccessUp(m, a.label)" :show-file-list="false" class="avatar-uploader" name="file"
                style="background: transparent;width: 80px;height: 80px;border: 1px solid #DCDFE6;border-radius: 6px;margin: 10px 0;">
                <img v-if="upData[a.label]" :src="javaApi+'/img/'+upData[a.label]" class="avatar"
                <img v-if="upData[a.label]" :src="javaApi + '/img/' + upData[a.label]" class="avatar"
                  style="width: 80px;height: 80px;border-radius: 6px;">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
              <el-cascader v-if="showCascader(a.label)" :options="data.cascaderField[a.label].tree" :placeholder="`请选择${a.value}`"
                :props="data.cascaderField.props" :show-all-levels="false" :value="upData[a.label]" clearable
                filterable size="small" style="width: 100%;" @change="m=>handleCascader(m,a.label)"></el-cascader>
              <el-cascader v-if="showCascader(a.label)" :options="data.cascaderField[a.label].tree"
                :placeholder="`请选择${a.value}`" :props="data.cascaderField.props" :show-all-levels="false"
                :value="upData[a.label]" clearable filterable size="small" style="width: 100%;"
                @change="m => handleCascader(m, a.label)"></el-cascader>
            </el-col>
          </el-row>
        </div>
@@ -247,63 +252,60 @@
      </span>
    </el-dialog>
    <el-dialog :close-on-click-modal="false" :visible.sync="addDia"
               :width="data.row==1?'500px':540+data.row * 200 + 'px'"
               append-to-body title="新增">
      :width="data.row == 1 ? '500px' : 540 + data.row * 200 + 'px'" append-to-body title="新增">
      <div v-if="addDia" class="body" style="max-height: 550px;overflow-y: auto;padding: 5px 10px 5px 0;">
        <div v-if="data.row > 1">
          <div v-for="(a, ai) in upHead" :key="ai+'yyyyy'" style="line-height: 50px;">
            <el-col :offset="1" :span="6/data.row" style="text-align: right;"><span v-if="showAddReq(a.label)"
          <div v-for="(a, ai) in upHead" :key="ai + 'yyyyy'" style="line-height: 50px;">
            <el-col :offset="1" :span="6 / data.row" style="text-align: right;"><span v-if="showAddReq(a.label)"
                class="required-span">*
              </span>{{a.value}}:</el-col>
            <el-col :span="16/data.row">
              <el-input v-if="showType(a.label, data.selectField) == null&&!showUpload(a.label)&&!showCascader(a.label)" v-model="upData[a.label]" :placeholder="`请输入${a.value}`" clearable
                size="small"></el-input>
              <el-select v-if="showType(a.label, data.selectField) != null" v-model="upData[a.label]" :multiple="data.selectField[a.label].choose"
              :placeholder="`请选择${a.value}`"
                clearable filterable size="small" style="width: 100%;">
                <el-option v-for="(b, bi) in data.selectField[a.label].select" :key="bi+'hhhh'" :label="b.label"
              </span>{{ a.value }}:</el-col>
            <el-col :span="16 / data.row">
              <el-input v-if="showType(a.label, data.selectField) == null && !showUpload(a.label) && !showCascader(a.label)"
                v-model="upData[a.label]" :placeholder="`请输入${a.value}`" clearable size="small"></el-input>
              <el-select v-if="showType(a.label, data.selectField) != null" v-model="upData[a.label]"
                :multiple="data.selectField[a.label].choose" :placeholder="`请选择${a.value}`" clearable filterable
                size="small" style="width: 100%;">
                <el-option v-for="(b, bi) in data.selectField[a.label].select" :key="bi + 'hhhh'" :label="b.label"
                  :value="b.value"></el-option>
              </el-select>
              <el-upload v-if="showUpload(a.label)" ref='upload'
                :accept='data.addUploadConfig.accept' :action="javaApi+data.addUploadConfig.url" :headers="token" :multiple="false"
                :on-error="onError" :on-success="m=>handleSuccessUp(m, a.label)" :show-file-list="false" class="avatar-uploader"
                name="file"
              <el-upload v-if="showUpload(a.label)" ref='upload' :accept='data.addUploadConfig.accept'
                :action="javaApi + data.addUploadConfig.url" :headers="token" :multiple="false" :on-error="onError"
                :on-success="m => handleSuccessUp(m, a.label)" :show-file-list="false" class="avatar-uploader" name="file"
                style="background: transparent;width: 80px;height: 80px;border: 1px solid #DCDFE6;border-radius: 6px;margin: 10px 0;">
                <img v-if="upData[a.label]" :src="javaApi+'/img/'+upData[a.label]" class="avatar"
                <img v-if="upData[a.label]" :src="javaApi + '/img/' + upData[a.label]" class="avatar"
                  style="width: 80px;height: 80px;border-radius: 6px;">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
              <el-cascader v-if="showCascader(a.label)" :options="data.cascaderField[a.label].tree" :placeholder="`请选择${a.value}`"
                :props="data.cascaderField.props" :show-all-levels="false" clearable filterable
                size="small" style="width: 100%;" @change="m=>handleCascader(m,a.label)"></el-cascader>
              <el-cascader v-if="showCascader(a.label)" :options="data.cascaderField[a.label].tree"
                :placeholder="`请选择${a.value}`" :props="data.cascaderField.props" :show-all-levels="false" clearable
                filterable size="small" style="width: 100%;" @change="m => handleCascader(m, a.label)"></el-cascader>
            </el-col>
          </div>
        </div>
        <div v-else>
          <el-row v-for="(a, ai) in upHead" :key="ai+'jjjjj'" style="line-height: 50px;">
          <el-row v-for="(a, ai) in upHead" :key="ai + 'jjjjj'" style="line-height: 50px;">
            <el-col :span="6" style="text-align: right;"><span v-if="showAddReq(a.label)" class="required-span">*
              </span>{{a.value}}:</el-col>
              </span>{{ a.value }}:</el-col>
            <el-col :offset="1" :span="16">
              <el-input v-if="showType(a.label, data.selectField) == null&&!showUpload(a.label)&&!showCascader(a.label)" v-model="upData[a.label]" :placeholder="`请输入${a.value}`" clearable
                size="small"></el-input>
              <el-select v-if="showType(a.label, data.selectField) != null" v-model="upData[a.label]" :multiple="data.selectField[a.label].choose"
              :placeholder="`请选择${a.value}`"
                clearable size="small" style="width: 100%;">
                <el-option v-for="(b, bi) in data.selectField[a.label].select" :key="bi+'mmmmmm'" :label="b.label"
              <el-input v-if="showType(a.label, data.selectField) == null && !showUpload(a.label) && !showCascader(a.label)"
                v-model="upData[a.label]" :placeholder="`请输入${a.value}`" clearable size="small"></el-input>
              <el-select v-if="showType(a.label, data.selectField) != null" v-model="upData[a.label]"
                :multiple="data.selectField[a.label].choose" :placeholder="`请选择${a.value}`" clearable size="small"
                style="width: 100%;">
                <el-option v-for="(b, bi) in data.selectField[a.label].select" :key="bi + 'mmmmmm'" :label="b.label"
                  :value="b.value"></el-option>
              </el-select>
              <el-upload v-if="showUpload(a.label)" ref='upload'
                :accept='data.addUploadConfig.accept' :action="javaApi+data.addUploadConfig.url" :headers="token" :multiple="false"
                :on-error="onError" :on-success="m=>handleSuccessUp(m, a.label)" :show-file-list="false" class="avatar-uploader"
                name="file"
              <el-upload v-if="showUpload(a.label)" ref='upload' :accept='data.addUploadConfig.accept'
                :action="javaApi + data.addUploadConfig.url" :headers="token" :multiple="false" :on-error="onError"
                :on-success="m => handleSuccessUp(m, a.label)" :show-file-list="false" class="avatar-uploader" name="file"
                style="background: transparent;width: 80px;height: 80px;border: 1px solid #DCDFE6;border-radius: 6px;margin: 10px 0;">
                <img v-if="upData[a.label]" :src="javaApi+'/img/'+upData[a.label]" class="avatar"
                <img v-if="upData[a.label]" :src="javaApi + '/img/' + upData[a.label]" class="avatar"
                  style="width: 80px;height: 80px;border-radius: 6px;">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
              <el-cascader v-if="showCascader(a.label)" :options="data.cascaderField[a.label].tree" :placeholder="`请选择${a.value}`"
                :props="data.cascaderField.props" :show-all-levels="false" clearable filterable
                size="small" style="width: 100%;" @change="m=>handleCascader(m,a.label)"></el-cascader>
              <el-cascader v-if="showCascader(a.label)" :options="data.cascaderField[a.label].tree"
                :placeholder="`请选择${a.value}`" :props="data.cascaderField.props" :show-all-levels="false" clearable
                filterable size="small" style="width: 100%;" @change="m => handleCascader(m, a.label)"></el-cascader>
            </el-col>
          </el-row>
        </div>
@@ -325,9 +327,9 @@
    </el-dialog>
    <el-dialog :visible.sync="uploadDia" title="数据导入" width="500px">
      <div style="margin: 0 auto;">
        <el-upload ref="upload" :accept="data.accept===undefined?'.csv':data.accept" :action="javaApi + inputUrl" :auto-upload="false" :data="{param: data.uploadStr}" :file-list="fileList"
          :headers="token" :limit="1" :on-change="beforeUpload" :on-error="onError" :on-success="onSuccess"
          drag name="file">
        <el-upload ref="upload" :accept="data.accept === undefined ? '.csv' : data.accept" :action="javaApi + inputUrl"
          :auto-upload="false" :data="{ param: data.uploadStr }" :file-list="fileList" :headers="token" :limit="1"
          :on-change="beforeUpload" :on-error="onError" :on-success="onSuccess" drag name="file">
          <i class="el-icon-upload"></i>
          <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
        </el-upload>
@@ -341,98 +343,57 @@
</template>
<script>
  export default {
    props: {
      selectionWidth: {
        type: String,
        default: () => '65'
      },
      columnMinWidth: {
        type: String,
        default: () => '155'
      },
      isColumnWidth: {
        type: Boolean,
        default: () => false
      },
      isShowZero: {
        type: Boolean,
        default: () => false
      },
      tableRowClassName: {
        type: Function
      },
      rowKey: {
        type: String,
        default: ()=>{
          return 'id'
        }
      },
      url: {
        type: String,
        default: () => null
      },
      upUrl: {
        type: String,
        default: () => null
      },
      delUrl: {
        type: String,
        default: () => null
      },
      downUrl: {
        type: String,
        default: () => null
      },
      inputUrl: {
        type: String,
        default: () => null
      },
      componentData: {
        type: Object,
        default: () => {
          return {
            entity: {
              orderBy: {
                field: 'id',
                order: 'asc'
              }
            },
            isIndex: false,
            showSelect: false,
            select: true,
            row: 1,
            do: [{
              id: 'update',
              font: '编辑',
              type: 'text',
              method: 'doDiy'
            }, {
              id: 'delete',
              font: '删除',
              type: 'text',
              method: 'doDiy'
            }],
            doDiy: true,
            tagField: [{
              label: 'state',
              select: [{
                value: '1',
                type: 'success',
                label: '启用'
              }, {
                value: '0',
                type: 'danger',
                label: '停用'
              }]
            }]
          }
        }
export default {
  props: {
    selectionWidth: {
      type: String,
      default: () => '65'
    },
    columnMinWidth: {
      type: String,
      default: () => '155'
    },
    isColumnWidth: {
      type: Boolean,
      default: () => false
    },
    isShowZero: {
      type: Boolean,
      default: () => false
    },
    tableRowClassName: {
      type: Function
    },
    rowKey: {
      type: String,
      default: () => {
        return 'id'
      }
    },
    data() {
      return {
        data: {
    url: {
      type: String,
      default: () => null
    },
    upUrl: {
      type: String,
      default: () => null
    },
    delUrl: {
      type: String,
      default: () => null
    },
    downUrl: {
      type: String,
      default: () => null
    },
    inputUrl: {
      type: String,
      default: () => null
    },
    componentData: {
      type: Object,
      default: () => {
        return {
          entity: {
            orderBy: {
              field: 'id',
@@ -443,795 +404,837 @@
          showSelect: false,
          select: true,
          row: 1,
          isPage: true, //
          do: [{
            id: 'update',
            font: '编辑',
            type: 'text',
            method: 'doDiy'
          }, {
            id: 'delete',
            font: '删除',
            type: 'text'
            type: 'text',
            method: 'doDiy'
          }],
          type: [],
          uploadStr: "",
          currentId: '', //当前高亮的ID
        },
        tableHead: [],
        tableData: [],
        multipleSelection: [],
        user: {},
        page: {
          current: 1,
          size: 20,
        },
        total: 0,
        loading: false,
        upDia: false,
        upData: {},
        upHead: [],
        upLoad: false,
        addDia: false,
        addUrl: null,
        addLoad: false,
        dataCopy: {},
        downDia: false,
        uploadDia: false,
        token: null,
        fileList: [],
        init: true,
        spanList: [
          // {
          //   arr:[],
          //   position:0
          // }
        ],
        specialSpanList: [
          // {
          //   arr:[],
          //   position:0
          // }
        ],
        param: {},
        specialKey:'table-'
          doDiy: true,
          tagField: [{
            label: 'state',
            select: [{
              value: '1',
              type: 'success',
              label: '启用'
            }, {
              value: '0',
              type: 'danger',
              label: '停用'
            }]
          }]
        }
      }
    },
    beforeUpdate() {
      this.$nextTick(() => {
        this.$refs.eltable.doLayout()
      })
    },
    mounted() {
      this.data = this.componentData
      this.dataCopy = this.HaveJson(this.componentData)
      if (this.data.init === undefined || this.data.init === true) {
        this.selectList()
      }
      this.token = {
        'token': sessionStorage.getItem('token')
      }
      this.specialKey = this.specialKey+Math.random()*100;
    },
    methods: {
      rowspan(spanArr, position, spanName) {
        this.tableData.forEach((item, index) => {
          if (index === 0) {
            spanArr.push(1);
            position = 0;
          } else {
            if (
              this.tableData[index][spanName] ===
              this.tableData[index - 1][spanName]
            ) {
              spanArr[position] += 1;
              spanArr.push(0);
            } else {
              spanArr.push(1);
              position = index;
            }
    }
  },
  data() {
    return {
      data: {
        entity: {
          orderBy: {
            field: 'id',
            order: 'asc'
          }
        });
        },
        isIndex: false,
        showSelect: false,
        select: true,
        row: 1,
        isPage: true, //
        do: [{
          font: '删除',
          type: 'text'
        }],
        type: [],
        uploadStr: "",
        currentId: '', //当前高亮的ID
      },
      spanMethod({
        row,
        column,
        rowIndex,
        columnIndex
      }) {
        // 一般的合并行
        if (this.data.spanConfig != undefined && this.data.spanConfig.rows && this.data.spanConfig.rows.length > 0) {
          let i = null;
          let obj = this.data.spanConfig.rows.find((item, index) => {
            i = index;
            return item.index == columnIndex
          })
          if (obj) {
            const _row = this.spanList[i].arr[rowIndex];
            const _col = _row > 0 ? 1 : 0;
            return {
              rowspan: _row,
              colspan: _col,
            };
      tableHead: [],
      tableData: [],
      multipleSelection: [],
      user: {},
      page: {
        current: 1,
        size: 20,
      },
      total: 0,
      loading: false,
      upDia: false,
      upData: {},
      upHead: [],
      upLoad: false,
      addDia: false,
      addUrl: null,
      addLoad: false,
      dataCopy: {},
      downDia: false,
      uploadDia: false,
      token: null,
      fileList: [],
      init: true,
      spanList: [
        // {
        //   arr:[],
        //   position:0
        // }
      ],
      specialSpanList: [
        // {
        //   arr:[],
        //   position:0
        // }
      ],
      param: {},
      specialKey: 'table-'
    }
  },
  beforeUpdate() {
    this.$nextTick(() => {
      this.$refs.eltable.doLayout()
    })
  },
  mounted() {
    this.data = this.componentData
    this.dataCopy = this.HaveJson(this.componentData)
    if (this.data.init === undefined || this.data.init === true) {
      this.selectList()
    }
    this.token = {
      'token': sessionStorage.getItem('token')
    }
    this.specialKey = this.specialKey + Math.random() * 100;
  },
  methods: {
    rowspan(spanArr, position, spanName) {
      this.tableData.forEach((item, index) => {
        if (index === 0) {
          spanArr.push(1);
          position = 0;
        } else {
          if (
            this.tableData[index][spanName] ===
            this.tableData[index - 1][spanName]
          ) {
            spanArr[position] += 1;
            spanArr.push(0);
          } else {
            spanArr.push(1);
            position = index;
          }
        }
      });
    },
    spanMethod({
      row,
      column,
      rowIndex,
      columnIndex
    }) {
      // 一般的合并行
      if (this.data.spanConfig != undefined && this.data.spanConfig.rows && this.data.spanConfig.rows.length > 0) {
        let i = null;
        let obj = this.data.spanConfig.rows.find((item, index) => {
          i = index;
          return item.index == columnIndex
        })
        if (obj) {
          const _row = this.spanList[i].arr[rowIndex];
          const _col = _row > 0 ? 1 : 0;
          return {
            rowspan: _row,
            colspan: _col,
          };
        }
      }
      // 特殊的合并行
      if (this.data.spanConfig != undefined && this.data.spanConfig.special && this.data.spanConfig.special.main &&
        this.data.spanConfig.special.rows && this.data.spanConfig.special.rows.length > 0) {
        let i = null;
        let obj = this.data.spanConfig.special.rows.find((item, index) => {
          i = index;
          return item.index == columnIndex
        })
        if (obj) {
          const _row = this.specialSpanList[i].arr[rowIndex];
          const _col = _row > 0 ? 1 : 0;
          return {
            rowspan: _row,
            colspan: _col,
          };
        }
      }
    },
    selectChange(val) {
      if (this.data.select) {
        this.multipleSelection = val;
      } else {
        this.multipleSelection = val[val.length - 1];
      }
      if (this.data.selectMethod != undefined) {
        if (this.$parent.$el.className.indexOf('el-') == 0) {
          this.$parent.$parent[this.data.selectMethod](val)
        } else {
          this.$parent[this.data.selectMethod](val)
        }
      }
    },
    select(val, row) {
      if (!this.data.select) {
        this.$refs['eltable'].clearSelection()
        this.$refs['eltable'].toggleRowSelection(row, true)
      }
    },
    rowClick(row, column, event) {
      if (this.data.select) {
        this.$refs['eltable'].toggleRowSelection(row)
      } else {
        this.$refs['eltable'].clearSelection()
        this.$refs['eltable'].toggleRowSelection(row, true)
      }
    },
    sizeChange(val) {
      this.page.size = val
      this.selectList('page')
    },
    currentChange(val) {
      this.page.current = val
      this.selectList('page')
    },
    // 调取表格查询接口
    selectList(val) {
      // console.log('val---', val)
      // console.log('this.page---', this.page)
      // this.loading = true
      if (val === undefined) {
        this.page.current = 1;
      }
      if (val === 'lastPage') {
        this.page.current = this.page.current - 1 // 例如删除本页最后一条数据,将当前页面定为上一页,除第一页外
      }
      // 不要分页就全查
      if (this.data.isPage != undefined && this.data.isPage != true) {
        this.page = {
          current: -1,
          size: -1,
        }
      }
      this.$axios.post(this.url, {
        page: this.page,
        entity: this.data.entity
      }, {
        headers: {
          'Content-Type': 'application/json'
        }
      }).then(res => {
        if (res.code === 201) {
          this.loading = false
          return
        }
        this.total = res.data.body.total
        this.tableHead = res.data.head
        this.tableData = res.data.body.records
        if (this.data.needSort !== undefined) {
          // 根据父组件传回来的needSort数组,判断哪些字段需要排序功能
          for (var i = 0; i < this.data.needSort.length; i++) {
            this.tableHead.forEach(item => {
              if (item.label === this.data.needSort[i]) {
                item.sort = 'custom'
              }
            })
          }
        }
        if (this.isShowZero) {
          // 工时管理-工时统计没有时间的就展示0
          this.tableData.map(item => {
            Object.keys(item).forEach(val => {
              if (item[val] === null && (val.includes('Hours') || val === 'total')) {
                item[val] = 0
              }
            })
          })
        }
        if (this.tableData.length === 0 && this.page.current > 1) {
          this.selectList('lastPage')
        }
        // if (this.isColumnWidth) {
        //   this.tableHead.forEach(item => {
        //     if(!item.width){
        //       if (item.value.length === 4) {
        //         item.width = 120
        //       } else if (item.value.length === 3){
        //         item.width = item.label.includes('Hours') ? 50 : 100
        //       } else if (item.value.length === 5){
        //         item.width = 130
        //       } else if (item.value.length === 7){
        //         item.width = 160
        //       } else if (item.value.length === 6){
        //         item.width = 150
        //       }  else if (item.value.length === 2){
        //         item.width = item.label.includes('Hours') ? 52 : 86
        //       } else {
        //         item.width = item.label.includes('Hours') ? 46 : 86
        //       }
        //     }
        //   })
        // }
        // console.log(JSON.stringify(this.tableHead)+"---------"+JSON.stringify(this.tableData))
        for (var a in this.data.selectField) {
          if (this.data.selectField[a].choose == true) {
            this.tableData.map(b => {
              try {
                b[a] = JSON.parse(b[a])
              } catch (e) { }
            })
          }
        }
        // 一般的合并行
        if (this.data.spanConfig != undefined && this.data.spanConfig.rows && this.data.spanConfig.rows.length >
          0) {
          this.spanList = [];
          this.data.spanConfig.rows.forEach((item, index) => {
            this.spanList.push({
              arr: [],
              position: 0
            })
            this.rowspan(this.spanList[index].arr, this.spanList[index].position, item.name);
          })
        }
        // 特殊的合并行
        if (this.data.spanConfig != undefined && this.data.spanConfig.special && this.data.spanConfig.special.main &&
          this.data.spanConfig.special.rows && this.data.spanConfig.special.rows.length > 0) {
          let i = null;
          let obj = this.data.spanConfig.special.rows.find((item, index) => {
            i = index;
            return item.index == columnIndex
        if (this.data.spanConfig != undefined && this.data.spanConfig.special && this.data.spanConfig.special
          .main && this.data.spanConfig.special.rows && this.data.spanConfig.special.rows.length > 0) {
          this.specialSpanList = []
          this.data.spanConfig.special.rows.forEach((item, index) => {
            this.specialSpanList.push({
              arr: [],
              position: 0
            })
            this.rowspan(this.specialSpanList[index].arr, this.specialSpanList[index].position, this.data
              .spanConfig.special.main);
          })
          if (obj) {
            const _row = this.specialSpanList[i].arr[rowIndex];
            const _col = _row > 0 ? 1 : 0;
            return {
              rowspan: _row,
              colspan: _col,
            };
          }
        }
      },
      selectChange(val) {
        if (this.data.select) {
          this.multipleSelection = val;
        } else {
          this.multipleSelection = val[val.length - 1];
        this.loading = false
      }).catch(e => {
        console.log('请刷新页面再尝试---', e)
        this.loading = false
        this.$message.error('请刷新页面再尝试')
      })
    },
    sortChange(ob) {
      this.data.entity.orderBy = {}
      this.data.entity.orderBy.field = ob.prop
      if (ob.order == 'ascending') {
        this.data.entity.orderBy.order = 'asc'
      } else if (ob.order == 'descending') {
        this.data.entity.orderBy.order = 'desc'
      } else {
        if (this.componentData.entity.orderBy != undefined) {
          this.data.entity.orderBy = this.HaveJson(this.dataCopy.entity.orderBy)
        }
        if (this.data.selectMethod != undefined) {
          if (this.$parent.$el.className.indexOf('el-') == 0) {
            this.$parent.$parent[this.data.selectMethod](val)
          } else {
            this.$parent[this.data.selectMethod](val)
          }
      }
      this.selectList()
    },
    // 展示tag
    showType(val, ob) {
      var str = ob[val]
      return str == undefined ? null : ob[val].select
    },
    // 展示操作栏
    showLink(val, ob) {
      var str = ob[val]
      return str == undefined ? null : ob[val].method
    },
    showAddReq(label) {
      if (this.data.requiredAdd == undefined) {
        return
      }
      for (var i = 0; i < this.data.requiredAdd.length; i++) {
        if (label == this.data.requiredAdd[i]) {
          return true
        }
      },
      select(val, row) {
        if (!this.data.select) {
          this.$refs['eltable'].clearSelection()
          this.$refs['eltable'].toggleRowSelection(row, true)
      }
      return false
    },
    showUpReq(label) {
      if (this.data.requiredUp == undefined) {
        return
      }
      for (var i = 0; i < this.data.requiredUp.length; i++) {
        if (label == this.data.requiredUp[i]) {
          return true
        }
      },
      rowClick(row, column, event) {
        if (this.data.select) {
          this.$refs['eltable'].toggleRowSelection(row)
        } else {
          this.$refs['eltable'].clearSelection()
          this.$refs['eltable'].toggleRowSelection(row, true)
      }
      return false
    },
    showUpload(label) {
      if (this.data.addUpload && this.data.addUpload.find(m => m == label)) {
        return true;
      } else {
        return false;
      }
    },
    showCascader(label) {
      if (this.data.cascaderField && this.data.cascaderField[label]) {
        return true;
      } else {
        return false;
      }
    },
    handleTree(arr, value) {
      let label = ''
      for (let i = 0; i < arr.length; i++) {
        if (arr[i].id == value) {
          label = arr[i].name
          return label
        } else if (arr[i].children) {
          label = this.handleTree(arr[i].children, value)
        }
      },
      sizeChange(val) {
        this.page.size = val
        this.selectList('page')
      },
      currentChange(val) {
        this.page.current = val
        this.selectList('page')
      },
      // 调取表格查询接口
      selectList(val) {
        // console.log('val---', val)
        // console.log('this.page---', this.page)
        // this.loading = true
        if(val===undefined){
          this.page.current = 1;
        }
        if (val === 'lastPage') {
          this.page.current = this.page.current - 1 // 例如删除本页最后一条数据,将当前页面定为上一页,除第一页外
        }
        // 不要分页就全查
        if (this.data.isPage != undefined && this.data.isPage != true) {
          this.page = {
            current: -1,
            size: -1,
          }
        }
        this.$axios.post(this.url, {
          page: this.page,
          entity: this.data.entity
        }, {
          headers: {
            'Content-Type': 'application/json'
          }
        }).then(res => {
          if (res.code === 201) {
            this.loading = false
            return
          }
          this.total = res.data.body.total
          this.tableHead = res.data.head
          this.tableData = res.data.body.records
          if (this.data.needSort !== undefined) {
            // 根据父组件传回来的needSort数组,判断哪些字段需要排序功能
            for (var i = 0; i < this.data.needSort.length; i++) {
              this.tableHead.forEach(item => {
                if (item.label === this.data.needSort[i]) {
                  item.sort = 'custom'
                }
              })
            }
          }
          if (this.isShowZero) {
            // 工时管理-工时统计没有时间的就展示0
            this.tableData.map(item => {
              Object.keys(item).forEach(val => {
                if (item[val] === null && (val.includes('Hours') || val === 'total')) {
                  item[val] = 0
                }
              })
            })
          }
          if (this.tableData.length === 0 && this.page.current > 1) {
            this.selectList('lastPage')
          }
          // if (this.isColumnWidth) {
          //   this.tableHead.forEach(item => {
          //     if(!item.width){
          //       if (item.value.length === 4) {
          //         item.width = 120
          //       } else if (item.value.length === 3){
          //         item.width = item.label.includes('Hours') ? 50 : 100
          //       } else if (item.value.length === 5){
          //         item.width = 130
          //       } else if (item.value.length === 7){
          //         item.width = 160
          //       } else if (item.value.length === 6){
          //         item.width = 150
          //       }  else if (item.value.length === 2){
          //         item.width = item.label.includes('Hours') ? 52 : 86
          //       } else {
          //         item.width = item.label.includes('Hours') ? 46 : 86
          //       }
          //     }
          //   })
          // }
          // console.log(JSON.stringify(this.tableHead)+"---------"+JSON.stringify(this.tableData))
          for (var a in this.data.selectField) {
            if (this.data.selectField[a].choose == true) {
              this.tableData.map(b => {
                try {
                  b[a] = JSON.parse(b[a])
                } catch (e) {}
              })
            }
          }
          // 一般的合并行
          if (this.data.spanConfig != undefined && this.data.spanConfig.rows && this.data.spanConfig.rows.length >
            0) {
            this.spanList = [];
            this.data.spanConfig.rows.forEach((item, index) => {
              this.spanList.push({
                arr: [],
                position: 0
              })
              this.rowspan(this.spanList[index].arr, this.spanList[index].position, item.name);
            })
          }
          // 特殊的合并行
          if (this.data.spanConfig != undefined && this.data.spanConfig.special && this.data.spanConfig.special
            .main && this.data.spanConfig.special.rows && this.data.spanConfig.special.rows.length > 0) {
            this.specialSpanList = []
            this.data.spanConfig.special.rows.forEach((item, index) => {
              this.specialSpanList.push({
                arr: [],
                position: 0
              })
              this.rowspan(this.specialSpanList[index].arr, this.specialSpanList[index].position, this.data
                .spanConfig.special.main);
            })
          }
          this.loading = false
        }).catch(e => {
          console.log('请刷新页面再尝试---', e)
          this.loading = false
          this.$message.error('请刷新页面再尝试')
        })
      },
      sortChange(ob) {
        this.data.entity.orderBy = {}
        this.data.entity.orderBy.field = ob.prop
        if (ob.order == 'ascending') {
          this.data.entity.orderBy.order = 'asc'
        } else if (ob.order == 'descending') {
          this.data.entity.orderBy.order = 'desc'
        } else {
          if (this.componentData.entity.orderBy != undefined) {
            this.data.entity.orderBy = this.HaveJson(this.dataCopy.entity.orderBy)
          }
        }
        this.selectList()
      },
      // 展示tag
      showType(val, ob) {
        var str = ob[val]
        return str == undefined ? null : ob[val].select
      },
      // 展示操作栏
      showLink(val, ob) {
        var str = ob[val]
        return str == undefined ? null : ob[val].method
      },
      showAddReq(label) {
        if (this.data.requiredAdd == undefined) {
          return
        }
        for (var i = 0; i < this.data.requiredAdd.length; i++) {
          if (label == this.data.requiredAdd[i]) {
            return true
          }
        }
        return false
      },
      showUpReq(label) {
        if (this.data.requiredUp == undefined) {
          return
        }
        for (var i = 0; i < this.data.requiredUp.length; i++) {
          if (label == this.data.requiredUp[i]) {
            return true
          }
        }
        return false
      },
      showUpload(label) {
        if (this.data.addUpload && this.data.addUpload.find(m => m == label)) {
          return true;
        } else {
          return false;
        }
      },
      showCascader(label) {
        if (this.data.cascaderField && this.data.cascaderField[label]) {
          return true;
        } else {
          return false;
        }
      },
      handleTree(arr, value) {
        let label = ''
        for (let i = 0; i < arr.length; i++) {
          if (arr[i].id == value) {
            label = arr[i].name
            return label
          } else if (arr[i].children) {
            label = this.handleTree(arr[i].children, value)
          }
        }
        return label
      },
      main(row, val) {
        if (val.method == undefined) return
        else if (val.method == 'doDiy') {
          if (val.id == 'update') { // 编辑操作
            this.upDia = true,
      }
      return label
    },
    main(row, val) {
      if (val.method == undefined) return
      else if (val.method == 'doDiy') {
        if (val.id == 'update') { // 编辑操作
          this.upDia = true,
            this.upData = this.HaveJson(row)
            this.upHead = this.HaveJson(this.tableHead)
            this.upHead.forEach((item, index) => {
              if (this.data.cascaderField && this.data.cascaderField[item.label]) {
                if (this.upData[item.label]) {
                  this.upData[item.label] = JSON.parse(this.upData[item.label])
                } else {
                  this.upData[item.label] = []
                }
              }
            })
            this.upHead = this.upHead.filter(a => a.label != 'createTime' && a.label != 'updateTime')
            delete this.upData.orderBy
            delete this.upData.createTime
            delete this.upData.updateTime
            delete this.upData.createUser
            delete this.upData.updateUser
            val.field.forEach(a => {
              if (this.upData[a] === undefined) {
                this.upHead.push({
                  value: a.split('=')[0],
                  label: a.split('=')[1]
                })
          this.upHead = this.HaveJson(this.tableHead)
          this.upHead.forEach((item, index) => {
            if (this.data.cascaderField && this.data.cascaderField[item.label]) {
              if (this.upData[item.label]) {
                this.upData[item.label] = JSON.parse(this.upData[item.label])
              } else {
                delete this.upData[a]
                for (var i = 0; i < this.upHead.length; i++) {
                  if (this.upHead[i].label == a) {
                    this.upHead.splice(i, 1);
                    i--
                    break
                  }
                }
                this.upData[item.label] = []
              }
            })
          } else if (val.id == 'delete') { // 删除操作
            if (this.delUrl == null) {
              this.$message.error('请给删除请求地址')
              return
            }
            this.$confirm('是否删除当前数据?', "警告", {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning"
            }).then(() => {
              this.$axios.post(this.delUrl, {
                id: row.id
              }).then(res => {
                if (res.code === 201) {
                  return
                }
                this.$message.success('删除成功')
                this.selectList('page')
                this.$emit('delete')
              }).catch(e => {
                this.$message.error('删除失败')
          })
          this.upHead = this.upHead.filter(a => a.label != 'createTime' && a.label != 'updateTime')
          delete this.upData.orderBy
          delete this.upData.createTime
          delete this.upData.updateTime
          delete this.upData.createUser
          delete this.upData.updateUser
          val.field.forEach(a => {
            if (this.upData[a] === undefined) {
              this.upHead.push({
                value: a.split('=')[0],
                label: a.split('=')[1]
              })
            }).catch(() => {})
          }
        } else if (val.id === 'parent') {
          delete row.orderBy
          this.$parent.$parent[val.method](row)
        } else {
          delete row.orderBy
          this.$parent[val.method](row)
        }
      },
      saveUpData() {
        if (this.upUrl == null) {
          this.$message.error('请给修改请求地址')
          return
        }
        for (var i = 0; i < this.data.requiredUp.length; i++) {
          // 必填校验
          if (this.upData[this.data.requiredUp[i]] === null || this.upData[this.data.requiredUp[i]] === '') {
            var list = this.upHead.filter(a => {
              if (a.label == this.data.requiredUp[i]) return a
            })
            if (list[0].value == undefined) continue
            this.$message.error(list[0].value + '是必填项')
            return
          }
        }
        for (var a in this.data.selectField) {
          if (this.data.selectField[a].choose == true) {
            this.upData[a] = JSON.stringify(this.upData[a])
          }
        }
        for (var i = 0; i < this.upHead.length; i++) {
          if(this.upHead[i].label == 'password'){
            if(this.upData[this.upHead[i].label]){
              const reg2 =/^(?=.*?[a-z])(?=.*?[A-Z])(?=.*?\d)(?=.*?[~!#@$%^*&()_+{}\[\]|\\;:'",<.>\/?])[a-zA-Z\d~!#@$%^*&()_+{}\[\]|\\;:'",<.>\/?]*$/;
              if (!reg2.test(this.upData[this.upHead[i].label])) {
                this.$message.error('密码必须包括数字、大小写字母以及特殊字符')
                return
              }
            }
          }
          if (this.data.cascaderField && this.data.cascaderField[this.upHead[i].label]) {
            if (this.upData[this.upHead[i].label]) {
              this.upData[this.upHead[i].label] = JSON.stringify(this.upData[this.upHead[i].label])
            } else {
              this.upData[this.upHead[i].label] = ''
            }
          }
        }
        this.upLoad = true
        this.$axios.post(this.upUrl, this.upData, {
          headers: {
            'Content-Type': 'application/json'
          }
        }).then(res => {
          if (res.code === 201) {
            this.upLoad = false
            return
          }
          this.$message.success('修改成功')
          this.upDia = false
          this.selectList('page')
          this.$refs.eltable.doLayout();
          this.upLoad = false
        }).catch(e => {
          this.$message.error('修改失败')
          this.upDia = false
          this.upLoad = false
        })
      },
      // 打开新增弹框回调
      openAddDia(addUrl, param) {
        this.addDia = true
        this.addUrl = addUrl
        this.param = param
        this.upData = {}
        this.tableHead.forEach((k, v) => {
          if (k.label != 'orderBy' && k.label != 'createTime' && k.label != 'updateTime' && k.label != 'createUser' && k.label != 'updateUser')
            this.upData[k.label] = null
        })
        this.upData = this.HaveJson(this.upData)
        this.upHead = this.HaveJson(this.tableHead)
        this.upHead = this.upHead.filter(a => a.label != 'createTime' && a.label != 'updateTime')
        var val = this.data.do.filter(a => a.id == 'update')[0]
        if (val == undefined) {
          val = {
            field: []
          }
        }
        val.field.forEach(a => {
          if (JSON.stringify(this.upData[a]) === undefined) {
            this.upHead.push({
              value: a.split('=')[0],
              label: a.split('=')[1]
            })
          } else {
            delete this.upData[a]
            for (var i = 0; i < this.upHead.length; i++) {
              if (this.upHead[i].label == a) {
                this.upHead.splice(i, 1);
                i--
                break
              delete this.upData[a]
              for (var i = 0; i < this.upHead.length; i++) {
                if (this.upHead[i].label == a) {
                  this.upHead.splice(i, 1);
                  i--
                  break
                }
              }
            }
          }
        })
      },
      // 新增回调
      saveAddData() {
        if (this.addUrl == null) {
          this.$message.error('请给添加请求地址')
          return
        }
        for (var i = 0; i < this.data.requiredAdd.length; i++) {
          if (this.upData[this.data.requiredAdd[i]] === null || this.upData[this.data.requiredAdd[i]] === '') {
            var list = this.upHead.filter(a => {
              if (a.label == this.data.requiredAdd[i]) return a
            })
            if (list[0].value == undefined) continue
            this.$message.error(list[0].value + '是必填项')
          })
        } else if (val.id == 'delete') { // 删除操作
          if (this.delUrl == null) {
            this.$message.error('请给删除请求地址')
            return
          }
        }
        this.addLoad = true
        for (var a in this.data.selectField) {
          if (this.data.selectField[a].choose == true) {
            this.upData[a] = JSON.stringify(this.upData[a])
          }
        }
        this.upHead.forEach((item, index) => {
          if (this.data.cascaderField && this.data.cascaderField[item.label]) {
            if (this.upData[item.label]) {
              this.upData[item.label] = JSON.stringify(this.upData[item.label])
            } else {
              this.upData[item.label] = ''
            }
          }
        })
        if (this.param !== undefined && this.param !== null) {
          for (let i in this.param) {
            this.upData[i] = this.param[i]
          }
        }
        this.$axios.post(this.addUrl, this.upData, {
          headers: {
            'Content-Type': 'application/json'
          }
        }).then(res => {
          if (res.code === 201) {
            this.addLoad = false
            return
          }
          this.$message.success('添加成功')
          this.addDia = false
          this.selectList('page')
          this.addLoad = false
        }).catch(e => {
          this.addDia = false
          this.addLoad = false
        })
      },
      openDownDia() {
        this.downDia = true
      },
      downFile(type) {
        if (this.downUrl == null) {
          this.$message.error('请给导出请求地址')
          return
        }
        var page = this.HaveJson(this.page)
        if (!type) {
          page.current = 0
          page.size = this.total
        }
        this.loading = true
        this.$axios.post(this.downUrl, {
          page: page,
          entity: this.data.entity
        }, {
          headers: {
            'Content-Type': 'application/json'
          }
        }).then(res => {
          if (res.code === 201) {
            this.loading = false
            return
          }
          this.downDia = false
          this.loading = false
          this.$message.success('导出成功')
          let eleLink = document.createElement('a')
          eleLink.style.display = 'none'
          eleLink.download = res.data
          eleLink.href = this.javaApi + '/outPath/' + res.data
          document.body.appendChild(eleLink)
          eleLink.click()
          document.body.removeChild(eleLink)
        }).catch(e => {
          console.log(e);
          this.loading = false
          this.$message.error('请刷新页面再尝试')
        })
      },
      openUpload() {
        if (this.inputUrl == null) {
          this.$message.error('请给导入请求地址')
          return
        }
        this.uploadDia = true
      },
      beforeUpload(file, fileList) {
        console.log(file.raw.type);
        if (file.raw.type != (this.data.inputType===undefined?'text/csv':this.data.inputType)) {
          this.$message.error('上传文件格式不正确');
          this.$refs.upload.clearFiles()
          return false;
        }
      },
      submitUpload() {
        if (this.$refs.upload.uploadFiles.length == 0) {
          this.$message.error('未选择文件')
          return
        }
        this.uploading = true
        this.$refs.upload.submit();
      },
      onSuccess(response, file, fileList) {
        this.$refs.upload.clearFiles()
        this.uploadDia = false
        this.uploading = false
        if (response.code == 201) {
          this.$message.error(response.message)
          return
        }
        this.$message.success('上传成功')
        this.selectList()
      },
      onError(err, file, fileList) {
        this.$message.error('上传失败')
        this.$refs.upload.clearFiles()
        this.uploading = false
      },
      // 操作按钮置灰判断
      isDisabled(label) {
        if (this.data.disabledUp == undefined) {
          return
        }
        for (var i = 0; i < this.data.disabledUp.length; i++) {
          if (label == this.data.disabledUp[i]) {
            return true
          }
        }
        return false
      },
      getSummaries(param) {
        const {
          columns,
          data
        } = param;
        const sums = [];
        columns.forEach((column, index) => {
          if (index === 0) {
            sums[index] = '合计';
            return;
          }
          const values = data.map(item => Number(item[column.property]));
          if (this.data.countFleid == undefined) {
            sums[index] = ''
            return
          }
          if (this.data.countFleid.filter(str => {
              return str === column.property
            }).length > 0) {
            sums[index] = values.reduce((prev, curr) => {
              const value = Number(curr);
              if (!isNaN(value)) {
                return prev + curr;
              } else {
                return prev;
              }
            }, 0);
            sums[index] += '';
          } else {
            sums[index] = '';
          }
        });
        return sums;
      },
      handleLinkEvent(row, val) {
        if (val.method == 'doDiy') {
          this.main(row, val)
        } else {
          this.$parent[val.method](row)
        }
      },
      getWidth() {
        let count = 0
        this.data.do.forEach(a => {
          count += a.font.length
        })
        return count * 15 + 60 + 'px'
      },
      handleSuccessUp(response, label) {
        if (typeof label === 'string') {
          if (response.code == 200) {
            this.upData[label] = response.data.url;
          }
        } else {
          if (response.code == 200) {
            this.$message.success('上传成功')
            this.selectList()
          }
        }
      },
      handleCascader(e, label) {
        this.upData[label] = e;
      },
      // 批量删除
      batchDelete() {
        if (this.multipleSelection && this.multipleSelection.length > 0) {
          this.$confirm('是否删除选中的数据?', "警告", {
          this.$confirm('是否删除当前数据?', "警告", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          }).then(() => {
            this.$axios.post(this.delUrl, {
              ids: JSON.stringify(this.multipleSelection.map(item => item.id))
              id: row.id
            }).then(res => {
              if (res.code === 201) {
                return
              }
              this.$message.success('删除成功')
              this.selectList('page')
              this.$emit('delete')
            }).catch(e => {
              this.$message.error('删除失败')
            })
          }).catch(() => {})
        } else {
          this.$message.error('请选择要删除的数据')
          }).catch(() => { })
        }
      },
      // 日工时管理辅助工时--批量审核和批准
      batchCheck(e) {
        if (this.multipleSelection && this.multipleSelection.length > 0) {
          const list = JSON.parse(JSON.stringify(this.multipleSelection))
          const state = e === 0 ? '不批准' : '已批准'
          let auxiliaryWorkingHoursDays = []
          list.forEach(item => {
            delete item.orderBy
            item.state = state
            auxiliaryWorkingHoursDays.push(item)
      } else if (val.id === 'parent') {
        delete row.orderBy
        this.$parent.$parent[val.method](row)
      } else {
        delete row.orderBy
        this.$parent[val.method](row)
      }
    },
    saveUpData() {
      if (this.upUrl == null) {
        this.$message.error('请给修改请求地址')
        return
      }
      for (var i = 0; i < this.data.requiredUp.length; i++) {
        // 必填校验
        if (this.upData[this.data.requiredUp[i]] === null || this.upData[this.data.requiredUp[i]] === '') {
          var list = this.upHead.filter(a => {
            if (a.label == this.data.requiredUp[i]) return a
          })
          this.$axios.post(this.$api.auxiliaryWorkingHoursDay.approve, {auxiliaryWorkingHoursDays: auxiliaryWorkingHoursDays
            },{
              headers: {
                'Content-Type': 'application/json'
              }
          if (list[0].value == undefined) continue
          this.$message.error(list[0].value + '是必填项')
          return
        }
      }
      for (var a in this.data.selectField) {
        if (this.data.selectField[a].choose == true) {
          this.upData[a] = JSON.stringify(this.upData[a])
        }
      }
      for (var i = 0; i < this.upHead.length; i++) {
        if (this.upHead[i].label == 'password') {
          if (this.upData[this.upHead[i].label]) {
            const reg2 = /^(?=.*?[a-z])(?=.*?[A-Z])(?=.*?\d)(?=.*?[~!#@$%^*&()_+{}\[\]|\\;:'",<.>\/?])[a-zA-Z\d~!#@$%^*&()_+{}\[\]|\\;:'",<.>\/?]*$/;
            if (!reg2.test(this.upData[this.upHead[i].label])) {
              this.$message.error('密码必须包括数字、大小写字母以及特殊字符')
              return
            }
          ).then(res => {
          }
        }
        if (this.data.cascaderField && this.data.cascaderField[this.upHead[i].label]) {
          if (this.upData[this.upHead[i].label]) {
            this.upData[this.upHead[i].label] = JSON.stringify(this.upData[this.upHead[i].label])
          } else {
            this.upData[this.upHead[i].label] = ''
          }
        }
      }
      this.upLoad = true
      this.$axios.post(this.upUrl, this.upData, {
        headers: {
          'Content-Type': 'application/json'
        }
      }).then(res => {
        if (res.code === 201) {
          this.upLoad = false
          return
        }
        this.$message.success('修改成功')
        this.upDia = false
        this.selectList('page')
        this.$refs.eltable.doLayout();
        this.upLoad = false
      }).catch(e => {
        this.$message.error('修改失败')
        this.upDia = false
        this.upLoad = false
      })
    },
    // 打开新增弹框回调
    openAddDia(addUrl, param) {
      this.addDia = true
      this.addUrl = addUrl
      this.param = param
      this.upData = {}
      this.tableHead.forEach((k, v) => {
        if (k.label != 'orderBy' && k.label != 'createTime' && k.label != 'updateTime' && k.label != 'createUser' && k.label != 'updateUser')
          this.upData[k.label] = null
      })
      this.upData = this.HaveJson(this.upData)
      this.upHead = this.HaveJson(this.tableHead)
      this.upHead = this.upHead.filter(a => a.label != 'createTime' && a.label != 'updateTime')
      var val = this.data.do.filter(a => a.id == 'update')[0]
      if (val == undefined) {
        val = {
          field: []
        }
      }
      val.field.forEach(a => {
        if (JSON.stringify(this.upData[a]) === undefined) {
          this.upHead.push({
            value: a.split('=')[0],
            label: a.split('=')[1]
          })
        } else {
          delete this.upData[a]
          for (var i = 0; i < this.upHead.length; i++) {
            if (this.upHead[i].label == a) {
              this.upHead.splice(i, 1);
              i--
              break
            }
          }
        }
      })
    },
    // 新增回调
    saveAddData() {
      if (this.addUrl == null) {
        this.$message.error('请给添加请求地址')
        return
      }
      for (var i = 0; i < this.data.requiredAdd.length; i++) {
        if (this.upData[this.data.requiredAdd[i]] === null || this.upData[this.data.requiredAdd[i]] === '') {
          var list = this.upHead.filter(a => {
            if (a.label == this.data.requiredAdd[i]) return a
          })
          if (list[0].value == undefined) continue
          this.$message.error(list[0].value + '是必填项')
          return
        }
      }
      this.addLoad = true
      for (var a in this.data.selectField) {
        if (this.data.selectField[a].choose == true) {
          this.upData[a] = JSON.stringify(this.upData[a])
        }
      }
      this.upHead.forEach((item, index) => {
        if (this.data.cascaderField && this.data.cascaderField[item.label]) {
          if (this.upData[item.label]) {
            this.upData[item.label] = JSON.stringify(this.upData[item.label])
          } else {
            this.upData[item.label] = ''
          }
        }
      })
      if (this.param !== undefined && this.param !== null) {
        for (let i in this.param) {
          this.upData[i] = this.param[i]
        }
      }
      this.$axios.post(this.addUrl, this.upData, {
        headers: {
          'Content-Type': 'application/json'
        }
      }).then(res => {
        if (res.code === 201) {
          this.addLoad = false
          return
        }
        this.$message.success('添加成功')
        this.addDia = false
        this.selectList('page')
        this.addLoad = false
      }).catch(e => {
        this.addDia = false
        this.addLoad = false
      })
    },
    openDownDia() {
      this.downDia = true
    },
    downFile(type) {
      if (this.downUrl == null) {
        this.$message.error('请给导出请求地址')
        return
      }
      var page = this.HaveJson(this.page)
      if (!type) {
        page.current = 0
        page.size = this.total
      }
      this.loading = true
      this.$axios.post(this.downUrl, {
        page: page,
        entity: this.data.entity
      }, {
        headers: {
          'Content-Type': 'application/json'
        }
      }).then(res => {
        if (res.code === 201) {
          this.loading = false
          return
        }
        this.downDia = false
        this.loading = false
        this.$message.success('导出成功')
        let eleLink = document.createElement('a')
        eleLink.style.display = 'none'
        eleLink.download = res.data
        eleLink.href = this.javaApi + '/outPath/' + res.data
        document.body.appendChild(eleLink)
        eleLink.click()
        document.body.removeChild(eleLink)
      }).catch(e => {
        console.log(e);
        this.loading = false
        this.$message.error('请刷新页面再尝试')
      })
    },
    openUpload() {
      if (this.inputUrl == null) {
        this.$message.error('请给导入请求地址')
        return
      }
      this.uploadDia = true
    },
    beforeUpload(file, fileList) {
      console.log(file.raw.type);
      if (file.raw.type != (this.data.inputType === undefined ? 'text/csv' : this.data.inputType)) {
        this.$message.error('上传文件格式不正确');
        this.$refs.upload.clearFiles()
        return false;
      }
    },
    submitUpload() {
      if (this.$refs.upload.uploadFiles.length == 0) {
        this.$message.error('未选择文件')
        return
      }
      this.uploading = true
      this.$refs.upload.submit();
    },
    onSuccess(response, file, fileList) {
      this.$refs.upload.clearFiles()
      this.uploadDia = false
      this.uploading = false
      if (response.code == 201) {
        this.$message.error(response.message)
        return
      }
      this.$message.success('上传成功')
      this.selectList()
    },
    onError(err, file, fileList) {
      this.$message.error('上传失败')
      this.$refs.upload.clearFiles()
      this.uploading = false
    },
    // 操作按钮置灰判断
    isDisabled(label) {
      if (this.data.disabledUp == undefined) {
        return
      }
      for (var i = 0; i < this.data.disabledUp.length; i++) {
        if (label == this.data.disabledUp[i]) {
          return true
        }
      }
      return false
    },
    getSummaries(param) {
      const {
        columns,
        data
      } = param;
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = '合计';
          return;
        }
        const values = data.map(item => Number(item[column.property]));
        if (this.data.countFleid == undefined) {
          sums[index] = ''
          return
        }
        if (this.data.countFleid.filter(str => {
          return str === column.property
        }).length > 0) {
          sums[index] = values.reduce((prev, curr) => {
            const value = Number(curr);
            if (!isNaN(value)) {
              return prev + curr;
            } else {
              return prev;
            }
          }, 0);
          sums[index] += '';
        } else {
          sums[index] = '';
        }
      });
      return sums;
    },
    handleLinkEvent(row, val) {
      if (val.method == 'doDiy') {
        this.main(row, val)
      } else {
        this.$parent[val.method](row)
      }
    },
    getWidth() {
      let count = 0
      this.data.do.forEach(a => {
        count += a.font.length
      })
      return count * 15 + 60 + 'px'
    },
    handleSuccessUp(response, label) {
      if (typeof label === 'string') {
        if (response.code == 200) {
          this.upData[label] = response.data.url;
        }
      } else {
        if (response.code == 200) {
          this.$message.success('上传成功')
          this.selectList()
        }
      }
    },
    handleCascader(e, label) {
      this.upData[label] = e;
    },
    // 批量删除
    batchDelete() {
      if (this.multipleSelection && this.multipleSelection.length > 0) {
        this.$confirm('是否删除选中的数据?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          this.$axios.post(this.delUrl, {
            ids: JSON.stringify(this.multipleSelection.map(item => item.id))
          }).then(res => {
            if (res.code === 201) {
              return
            }
            this.$parent.submitBatchCheckDialog()
            this.$message.success('操作成功')
            this.$message.success('删除成功')
            this.selectList('page')
          }).catch(e => {
            this.$message.error('删除失败')
          })
        } else {
          this.$message.error('请选择至少一条数据')
        }).catch(() => { })
      } else {
        this.$message.error('请选择要删除的数据')
      }
    },
    // 日工时管理辅助工时--批量审核和批准
    batchCheck(e) {
      if (this.multipleSelection && this.multipleSelection.length > 0) {
        const list = JSON.parse(JSON.stringify(this.multipleSelection))
        const state = e === 0 ? '不批准' : '已批准'
        let auxiliaryWorkingHoursDays = []
        list.forEach(item => {
          delete item.orderBy
          item.state = state
          auxiliaryWorkingHoursDays.push(item)
        })
        this.$axios.post(this.$api.auxiliaryWorkingHoursDay.approve, {
          auxiliaryWorkingHoursDays: auxiliaryWorkingHoursDays
        }, {
          headers: {
            'Content-Type': 'application/json'
          }
        }
      },
      getRedColor(label,row){
        if(this.data.cellSpecialStyle&&this.data.cellSpecialStyle.redColorByKey&&label.includes(this.data.cellSpecialStyle.redColorByKey)&&row[(label.replace(this.data.cellSpecialStyle.redColorByKey, ""))]){
          return true
        }else{
          return false
        }
        ).then(res => {
          if (res.code === 201) {
            return
          }
          this.$parent.submitBatchCheckDialog()
          this.$message.success('操作成功')
        })
      } else {
        this.$message.error('请选择至少一条数据')
      }
    },
    getRedColor(label, row) {
      if (this.data.cellSpecialStyle && this.data.cellSpecialStyle.redColorByKey && label.includes(this.data.cellSpecialStyle.redColorByKey) && row[(label.replace(this.data.cellSpecialStyle.redColorByKey, ""))]) {
        return true
      } else {
        return false
      }
    }
  }
}
</script>
src/components/materialOrder/dataLookVisible.vue
@@ -2,15 +2,16 @@
  <div>
    <el-dialog title="数据查看" :visible.sync="isShow" width="80%" @closed="$emit('closeDataLook')">
      <ul class="tab">
        <li v-for="(m,i) in dataVisibleTitle" :key="i" :class="{active:i===dataVisibleIndex}" @click="handleDataVisibleTab(m,i)">{{m.label}}</li>
        <li v-for="(m, i) in dataVisibleTitle" :key="i" :class="{ active: i === dataVisibleIndex }"
          @click="handleDataVisibleTab(m, i)">{{ m.label }}</li>
      </ul>
      <div style="height: 70vh;overflow-y: auto;">
        <ValueTable ref="ValueTableDataLook" :url="$api.insOrder.selectSampleAndProductByOrderId"
                    :key="upIndex"
                    :componentData="componentDataDataLook"/>
        <ValueTable ref="ValueTableDataLook" :url="$api.insOrder.selectSampleAndProductByOrderId" :key="upIndex"
          :componentData="componentDataDataLook" />
      </div>
    </el-dialog>
    <un-pass-retest-result :retestVisible="retestVisible" :retestInfo="retestInfo" @closeRetestLook="closeRetestLook" v-if="retestVisible"></un-pass-retest-result>
    <un-pass-retest-result :retestVisible="retestVisible" :retestInfo="retestInfo" @closeRetestLook="closeRetestLook"
      v-if="retestVisible"></un-pass-retest-result>
  </div>
</template>
@@ -21,7 +22,7 @@
export default {
  name: "dataLookVisible",
  // import 引入的组件需要注入到对象中才能使用
  components: {UnPassRetestResult, ValueTable},
  components: { UnPassRetestResult, ValueTable },
  props: {
    dataDialogVisible: {
      type: Boolean,
@@ -29,7 +30,7 @@
    },
    dataLookInfo: {
      type: Object,
      default: () => {}
      default: () => { }
    },
  },
  data() {
@@ -62,8 +63,8 @@
            font: '不合格复测查看',
            type: 'text',
            method: 'getRetestResult',
            disabFun: (row, index) =>  {
              return row.insResult!=0
            disabled: (row, index) => {
              return row.insResult != 0
            }
          }
        ],
@@ -76,11 +77,11 @@
              value: 1,
              label: '合格',
              type: 'success'
            },{
            }, {
              value: 0,
              label: '不合格',
              type: 'danger'
            },{
            }, {
              value: 3,
              label: '不判定',
              type: ''
@@ -101,7 +102,7 @@
  // 方法集合
  methods: {
    // 切换数据查看tab栏
    handleDataVisibleTab (m, i) {
    handleDataVisibleTab(m, i) {
      this.dataVisibleIndex = i
      this.refreshTable()
    },
@@ -117,14 +118,14 @@
      })
    },
    // 查看不合格复测结果
    getRetestResult (row) {
      this.$axios.get(this.$api.insOrder.getRetestResult+'?insProductId='+row.insProductId).then(res => {
    getRetestResult(row) {
      this.$axios.get(this.$api.insOrder.getRetestResult + '?insProductId=' + row.insProductId).then(res => {
        if (res.code == 201) return
        this.retestVisible = true
        this.retestInfo = res.data
      })
    },
    closeRetestLook () {
    closeRetestLook() {
      this.retestVisible = false
    },
  },
src/components/rawMaterialInspection/dataLookVisible.vue
@@ -2,15 +2,16 @@
  <div>
    <el-dialog title="数据查看" :visible.sync="isShow" width="80%" @closed="$emit('closeDataLook')">
      <ul class="tab">
        <li v-for="(m,i) in dataVisibleTitle" :key="i" :class="{active:i===dataVisibleIndex}" @click="handleDataVisibleTab(m,i)">{{m.label}}</li>
        <li v-for="(m, i) in dataVisibleTitle" :key="i" :class="{ active: i === dataVisibleIndex }"
          @click="handleDataVisibleTab(m, i)">{{ m.label }}</li>
      </ul>
      <div style="height: 70vh;overflow-y: auto;">
        <ValueTable ref="ValueTableDataLook" :url="$api.insOrder.selectSampleAndProductByOrderId"
                    :key="upIndex"
                    :componentData="componentDataDataLook"/>
        <ValueTable ref="ValueTableDataLook" :url="$api.insOrder.selectSampleAndProductByOrderId" :key="upIndex"
          :componentData="componentDataDataLook" />
      </div>
    </el-dialog>
    <un-pass-retest-result :retestVisible="retestVisible" :retestInfo="retestInfo" @closeRetestLook="closeRetestLook" v-if="retestVisible"></un-pass-retest-result>
    <un-pass-retest-result :retestVisible="retestVisible" :retestInfo="retestInfo" @closeRetestLook="closeRetestLook"
      v-if="retestVisible"></un-pass-retest-result>
  </div>
</template>
@@ -21,7 +22,7 @@
export default {
  name: "dataLookVisible",
  // import 引入的组件需要注入到对象中才能使用
  components: {UnPassRetestResult, ValueTable},
  components: { UnPassRetestResult, ValueTable },
  props: {
    dataDialogVisible: {
      type: Boolean,
@@ -29,7 +30,7 @@
    },
    dataLookInfo: {
      type: Object,
      default: () => {}
      default: () => { }
    },
  },
  data() {
@@ -62,8 +63,8 @@
            font: '不合格复测查看',
            type: 'text',
            method: 'getRetestResult',
            disabFun: (row, index) =>  {
              return row.insResult!=0
            disabled: (row, index) => {
              return row.insResult != 0
            }
          }
        ],
@@ -76,11 +77,11 @@
              value: 1,
              label: '合格',
              type: 'success'
            },{
            }, {
              value: 0,
              label: '不合格',
              type: 'danger'
            },{
            }, {
              value: 3,
              label: '不判定',
              type: ''
@@ -101,7 +102,7 @@
  // 方法集合
  methods: {
    // 切换数据查看tab栏
    handleDataVisibleTab (m, i) {
    handleDataVisibleTab(m, i) {
      this.dataVisibleIndex = i
      this.refreshTable()
    },
@@ -117,14 +118,14 @@
      })
    },
    // 查看不合格复测结果
    getRetestResult (row) {
      this.$axios.get(this.$api.insOrder.getRetestResult+'?insProductId='+row.insProductId).then(res => {
    getRetestResult(row) {
      this.$axios.get(this.$api.insOrder.getRetestResult + '?insProductId=' + row.insProductId).then(res => {
        if (res.code == 201) return
        this.retestVisible = true
        this.retestInfo = res.data
      })
    },
    closeRetestLook () {
    closeRetestLook() {
      this.retestVisible = false
    },
  },
src/views/CNAS/systemManagement/documentControl/components/DistributionCollectionRecord.vue
@@ -152,7 +152,7 @@
          <div class="search_thing">
            <div class="search_label">上传附件:</div>
            <div class="search_input"><el-upload :auto-upload="false" :multiple="false" :on-change="handleChangeUpload"
                accept='.pdf,.doc,.docx,.xls,.xlsx' action="#" style="margin: 8px 0 0px 50px;">
                accept='.pdf,.doc,.docx,.xls,.xlsx' action="#" style="margin: 8px 0 0px 50px;" ref="upload">
                <el-button size="small" type="primary">上传附件</el-button>
              </el-upload></div>
          </div>
@@ -245,7 +245,7 @@
              clickFun: (row) => {
                this.handleDelete(row);
              },
              disabFun: (row, index) => {
              disabled: (row, index) => {
                return row.documentState == '通过'
              }
            },
@@ -255,7 +255,7 @@
              clickFun: (row) => {
                this.handleLook(row);
              },
              disabFun: (row, index) => {
              disabled: (row, index) => {
                return !row.url
              }
            },
@@ -265,7 +265,7 @@
              clickFun: (row) => {
                this.handleCheck(row);
              },
              disabFun: (row, index) => {
              disabled: (row, index) => {
                return row.receiveUser != this.userId || row.documentState == '通过'
              }
            },
@@ -480,6 +480,8 @@
      this.addInfo = this.HaveJson(row)
      this.radio = '回收'
      this.addDialogVisible = true
      this.file = null
      this.$refs.upload.clearFiles()
    },
    // 审核
    handleCheck(row) {
src/views/CNAS/systemManagement/documentControl/components/FileChangeRequest.vue
@@ -13,7 +13,7 @@
      </div>
      <div class="btns">
        <el-button size="small" type="primary"
          @click="addDialogVisible = true, addInfo = {}, currentFile = {}, title = '文件变更申请'">文件变更申请</el-button>
          @click="addDialogVisible = true, addInfo = {}, currentFile = {}, title = '文件变更申请', file = null">文件变更申请</el-button>
        <el-button :loading="outLoading" size="small" type="primary" @click="handleOut">导出</el-button>
      </div>
    </div>
src/views/CNAS/systemManagement/documentControl/index.vue
@@ -3,7 +3,12 @@
    <el-tabs type="border-card" v-model="activeName" style="height: 100%;">
      <el-tab-pane :label="item.name" :name="item.component" v-for="(item, index) in tabList" :key="index"
        style="height: 100%;">
        <component :is="item.component" :key="item.component"></component>
        <component :is="item.component" :key="item.component" v-if="activeName == item.component"></component>
        <!-- <FileList v-if="item.component == 'FileList'" />
        <ControlledFileApplication v-if="item.component == 'ControlledFileApplication'" />
        <DistributionCollectionRecord v-if="item.component == 'DistributionCollectionRecord'" />
        <FileChangeRequest v-if="item.component == 'FileChangeRequest'" />
        <FileObsoletionRequest v-if="item.component == 'FileObsoletionRequest'" /> -->
      </el-tab-pane>
    </el-tabs>
  </div>
src/views/CNAS/systemManagement/documentRecords/approvalRecord.vue
@@ -284,7 +284,7 @@
      exportOutManageRecordCheck(this.queryParams).then(res => {
        this.outLoading = false
        if (res.code == 201) return this.$message.error('导出失败')
        let url = this.javaApi + '/word/' + res.message
        let url = this.javaApi + '/word/' + res.data
        this.$download.saveAs(url, '文件审批记录')
      })
    },
src/views/CNAS/systemManagement/documentRecords/regularReviewsRecord.vue
@@ -224,7 +224,7 @@
          font: '查看',
          type: 'text',
          method: 'handleLook',
          disabFun: (row, index) => {
          disabled: (row, index) => {
            return !row.url
          }
        }, {
@@ -232,7 +232,7 @@
          font: '下载',
          type: 'text',
          method: 'handleDown0',
          disabFun: (row, index) => {
          disabled: (row, index) => {
            return !row.url
          }
        },
@@ -241,7 +241,7 @@
          font: '提交',
          type: 'text',
          method: 'handleSubmit',
          disabFun: (row, index) => {
          disabled: (row, index) => {
            return !!row.submitUserName
          }
        }, {
@@ -249,7 +249,7 @@
          font: '批准',
          type: 'text',
          method: 'handleApproval',
          disabFun: (row, index) => {
          disabled: (row, index) => {
            return !row.submitUserName || !!row.ratifyUserName
          }
        }],