李旭东
2023-11-24 c69b7fc84e32816bc21716433dac4a97dd87f63f
新增管片功能修改
已修改3个文件
2251 ■■■■■ 文件已修改
web/src/api/modules/ductpiecePLM.js 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/DuctpiecePLM/DuctProduct/ProductIndex.vue 1106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/DuctpiecePLM/DuctpieceIndex.vue 1106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/api/modules/ductpiecePLM.js
@@ -26,7 +26,6 @@
      url: '/m/pipeInfo/findList',
      data: {
        proId: params.proId,
        segmentId: params.segmentId,
        ringNum: params.ringNum,
        groupId: params.groupId,
        checkResult: params.checkResult,
@@ -56,14 +55,17 @@
  // 获取全部钢筋笼与模具信息
  getAllSteelPipeData: (params) =>
    axios.post('/m/steelProduce/ModSteelPullDown', params),
  /**
   * agv监控
   */
     * agv监控
    */
  searchAgvLists: (params) =>
    axios.post('/screen/pl/agv', params),
  axios.post('/screen/pl/agv', params),
  // 获取时间信息
  getPipeTimeData: (params) =>
    axios.post('/m/pipeInfo/updateDateInfo', params),
  // 修改时间信息
  updatePipeTimeData: (params) =>
    axios.post('/m/pipeInfo/updatePipeDate', params),
  /**
   * 水养模块接口
   * */
@@ -110,6 +112,7 @@
      data: {
        waterCultivatedId: params.waterCultivatedId,
        ringNum: params.ringNum,
        proId:params.proId,
        blockNum: params.blockNum,
        reinforcement: params.reinforcement,
        groutingHoles: params.groutingHoles,
@@ -119,6 +122,18 @@
        outCulEndTime: params.outCulEndTime
      }
    }),
  // 根据项目查询环号
  getProjectRingNumData: (params) =>
    axios.get('/m/waterCultivated/ringNumList', {params}),
  // 根据项目  环号查询管片信息
  getProjectRingPipeData: (params) =>
    axios.post('/m/pipeCultivated/pipeInfoList', params),
  // 获取水养池下拉
  getWaterCultivatedData: (params) =>
    axios.post('/m/waterCultivated/pulldown', params),
  // 提交入池
  submitpipeEnterCistern: (params) =>
        axios.post('/m/pipeCultivated/intowaterWeb', params),
  /*
   * 管片蒸养
@@ -207,6 +222,13 @@
  //获取所有环号
  getAllPipInfos: params =>
    axios.post('/materials/pipeOut/pipeInfoInList', params),
    // 获取堆场下拉信息
    getRepoRecordData: () =>
        axios.post('/m/repoRecord/repoPullDown'),
  // 管片入库
    submitPipePutbankInfo: (params) =>
    axios.post('/m/repoRecord/intoRepoWeb', params),
  
  /**
   * 发运管理中的GPS设备管理
@@ -288,7 +310,8 @@
        pageSize: params.pageSize
      },
      data: {
        ringNum: params.ringNum
        ringNum: params.ringNum,
        proId:params.proId
      }
    }),
  // 获取管片详情
web/src/views/DuctpiecePLM/DuctProduct/ProductIndex.vue
@@ -3,12 +3,18 @@
    <div class="main_header">
      <div class="header_item">
        <span class="header_label">项目名称:</span>
        <el-select v-model="projectId" clearable placeholder="请选择项目" @change="changeHeaderProject">
        <el-select
          v-model="projectId"
          clearable
          placeholder="请选择项目"
          @change="changeHeaderProject"
        >
          <el-option
            v-for="item in projectData"
            :key="item.proId"
            :label="item.proName"
            :value="item.proId">
            :value="item.proId"
          >
          </el-option>
        </el-select>
      </div>
@@ -23,7 +29,8 @@
            v-for="item in groupData"
            :key="item.groupId"
            :label="item.groupName"
            :value="item.groupId">
            :value="item.groupId"
          >
          </el-option>
        </el-select>
      </div>
@@ -42,7 +49,8 @@
            v-for="item in reinforcementData"
            :key="item.hasSteel"
            :label="item.dictName"
            :value="item.hasSteel">
            :value="item.hasSteel"
          >
          </el-option>
        </el-select>
      </div>
@@ -53,9 +61,10 @@
            v-for="item in groutingHolesData"
            :key="item.groutingHoles"
            :label="item.dictName"
            :value="item.groutingHoles">
            :value="item.groutingHoles"
          >
          </el-option>
        </el-select>
        </el-select>
      </div>
      <div class="header_item">
        <span class="header_label">块号:</span>
@@ -64,7 +73,8 @@
            v-for="item in blockNumData"
            :key="item.blockNum"
            :label="item.dictName"
            :value="item.blockNum">
            :value="item.blockNum"
          >
          </el-option>
        </el-select>
      </div>
@@ -76,7 +86,8 @@
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          value-format="yyyy-MM-dd">
          value-format="yyyy-MM-dd"
        >
        </el-date-picker>
      </div>
      <!-- <div class="header_item">
@@ -98,51 +109,119 @@
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          value-format="yyyy-MM-dd">
          value-format="yyyy-MM-dd"
        >
        </el-date-picker>
      </div>
      <div class="header_item">
        <el-button v-if="showButton('search')" icon="el-icon-search" @click="searchDuctpiecePLMList(true)">查询</el-button>
        <el-button v-if="showButton('insert')" icon="el-icon-download" @click="propInsert()">新增管片</el-button>
        <el-button v-if="showButton('insert')" icon="el-icon-download" @click="exportExcel()">导出Excel</el-button>
        <el-button
          v-if="showButton('search')"
          icon="el-icon-search"
          @click="searchDuctpiecePLMList(true)"
          >查询</el-button
        >
        <el-button
          v-if="showButton('insert')"
          icon="el-icon-download"
          @click="propInsert()"
          >新增管片</el-button
        >
        <el-button
          v-if="showButton('export')"
          icon="el-icon-download"
          @click="exportExcel()"
          >导出Excel</el-button
        >
      </div>
    </div>
    <div class="main_content">
      <el-table
        v-loading="loading"
        :data="ductpieceList"
        height="100%">
      <el-table v-loading="loading" :data="ductpieceList" height="100%">
        <el-table-column label="序号" width="60" align="center">
          <template #default="scope">
            <span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span>
            <span>{{ (pageNum - 1) * pageSize + scope.$index + 1 }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="ringNum" label="环号" align="center"></el-table-column>
        <el-table-column prop="proName" label="项目名称" align="center"></el-table-column>
        <el-table-column prop="pipeNum" label="管片编号" align="center"></el-table-column>
        <el-table-column prop="turnName" label="转向" align="center"></el-table-column>
        <el-table-column prop="reinforcementName" label="配筋" align="center"></el-table-column>
        <el-table-column prop="groutingHolesName" label="注浆孔" align="center"></el-table-column>
        <el-table-column prop="blockNumName" label="块号" align="center"></el-table-column>
        <el-table-column
          prop="reinforcementName"
          label="配筋"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="groutingHolesName"
          label="注浆孔"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="blockNumName"
          label="块号"
          align="center"
        ></el-table-column>
        <el-table-column prop="mouldNum" label="模具" align="center"></el-table-column>
        <el-table-column prop="intoModTime" label="入模时间" align="center"></el-table-column>
        <el-table-column
          prop="intoModTime"
          label="入模时间"
          align="center"
        ></el-table-column>
        <!-- <el-table-column prop="pouringTime" label="浇筑时间" align="center"></el-table-column> -->
        <el-table-column prop="checkTime" label="质检时间" align="center"></el-table-column>
        <el-table-column prop="groupName" label="生产班组" align="center"></el-table-column>
        <el-table-column
          prop="checkTime"
          label="质检时间"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="groupName"
          label="生产班组"
          align="center"
        ></el-table-column>
        <el-table-column label="质量标注" align="center">
          <template #default="{ row }">
            <div>
               {{ row.checkResult == 0 ? '未质检' : row.checkResult == 1 ? '合格' : row.checkResult == 2 ? '不合格' : row.checkResult == 3 ? '报废' : ''}}
              {{
                row.checkResult == 0
                  ? "未质检"
                  : row.checkResult == 1
                  ? "合格"
                  : row.checkResult == 2
                  ? "不合格"
                  : row.checkResult == 3
                  ? "报废"
                  : ""
              }}
            </div>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" width="300">
          <template #default="{ row }">
            <template v-if="showButton('update') && row.checkResult !== 1">
              <el-button class="table_btn" size="mini" @click="propIssue(row)">存在问题</el-button>
            <template v-if="showButton('update') && [2, 3].includes(row.checkResult)">
              <el-button class="table_btn" size="mini" @click="propIssue(row)"
                >存在问题</el-button
              >
            </template>
            <el-button class="table_btn" size="mini" v-if="showButton('update') && row.checkResult == 0" @click="propUpdate(row)">修改环号</el-button>
            <el-button class="table_btn" size="mini" v-if="showButton('delete')" @click="propCheckHistory(row)">质量追溯</el-button>
            <el-button
              class="table_btn"
              size="mini"
              v-if="showButton('update')"
              @click="propUpdate(row)"
              >修改环号</el-button
            >
            <el-button
              class="table_btn"
              size="mini"
              v-if="showButton('update')"
              @click="propUpdateTime(row)"
              >修改时间</el-button
            >
            <el-button
              class="table_btn"
              size="mini"
              v-if="showButton('delete')"
              @click="propCheckHistory(row)"
              >质量追溯</el-button
            >
          </template>
        </el-table-column>
      </el-table>
@@ -156,24 +235,33 @@
        :page-sizes="[10, 20, 50, 100]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total">
        :total="total"
      >
      </el-pagination>
    </div>
    <el-dialog
      class="prop_dialog"
      title="存在问题"
      :visible.sync="asyncDuctPiece"
      width="35%">
      <el-form ref="form" :model="formDuctPiece" :rules="rulesDuctPiece" label-width="auto" class="rule_form">
      width="35%"
    >
      <el-form
        ref="form"
        :model="formDuctPiece"
        :rules="rulesDuctPiece"
        label-width="auto"
        class="rule_form"
      >
        <el-form-item label="质检结果:">
          <span class="issue_status">{{checkResultStr}}</span>
          <span class="issue_status">{{ checkResultStr }}</span>
        </el-form-item>
        <el-form-item label="存在问题:">
          <el-input
            v-model="formDuctPiece.existProblem"
          <el-input
            v-model="formDuctPiece.existProblem"
            type="textarea"
            disabled
            placeholder="请输入存在问题"></el-input>
            placeholder="请输入存在问题"
          ></el-input>
        </el-form-item>
        <el-form-item label="问题图片:">
          <div class="problem_content">
@@ -181,25 +269,28 @@
              v-for="item in fileList"
              :key="item.id"
              class="problem_image"
              :src="item.url">
              :src="item.url"
            >
            </el-image>
          </div>
        </el-form-item>
        <el-form-item label="问题处理结果:">
          <el-input
            v-model="formDuctPiece.exeProResult"
          <el-input
            v-model="formDuctPiece.exeProResult"
            type="textarea"
            clearable
            placeholder="请输入问题处理结果"></el-input>
            clearable
            placeholder="请输入问题处理结果"
          ></el-input>
        </el-form-item>
        <el-form-item label="备注:">
          <el-input
            v-model="formDuctPiece.exeProNote"
          <el-input
            v-model="formDuctPiece.exeProNote"
            type="textarea"
            clearable
            clearable
            placeholder="请输入备注"
            maxlength="200"
            show-word-limit></el-input>
            show-word-limit
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer">
@@ -212,47 +303,49 @@
      class="prop_dialog"
      title="质量追溯"
      :visible.sync="asyncRetrospect"
      width="70%">
      width="70%"
    >
      <div class="retrospect_content">
        <div class="retrospect_content_title">
          钢筋笼信息
        </div>
        <div class="retrospect_content_title">钢筋笼信息</div>
        <div class="retrospect_content_table">
          <div
            class="table_item"
            :style="{width: `calc(100% / ${asyncCageInfo.length})`}"
          <div
            class="table_item"
            :style="{ width: `calc(100% / ${asyncCageInfo.length})` }"
            v-for="item in asyncCageInfo"
            :key="item.id">
            <div class="table_item_chunk table_th">{{item.label}}</div>
            <div class="table_item_chunk table_td">{{
              item.value === 'steelCheckResult' ? showCheckResult(retrospectInfo[item.value]) : retrospectInfo[item.value]}}
            :key="item.id"
          >
            <div class="table_item_chunk table_th">{{ item.label }}</div>
            <div class="table_item_chunk table_td">
              {{
                item.value === "steelCheckResult"
                  ? showCheckResult(retrospectInfo[item.value])
                  : retrospectInfo[item.value]
              }}
            </div>
          </div>
        </div>
        <div class="retrospect_content_title">
          模具信息
        </div>
        <div class="retrospect_content_title">模具信息</div>
        <div class="retrospect_content_table">
          <div
            class="table_item"
            :style="{width: `calc(100% / ${asyncMouldInfo.length})`}"
          <div
            class="table_item"
            :style="{ width: `calc(100% / ${asyncMouldInfo.length})` }"
            v-for="item in asyncMouldInfo"
            :key="item.id">
            <div class="table_item_chunk table_th">{{item.label}}</div>
            <div class="table_item_chunk table_td">{{retrospectInfo[item.value]}}</div>
            :key="item.id"
          >
            <div class="table_item_chunk table_th">{{ item.label }}</div>
            <div class="table_item_chunk table_td">{{ retrospectInfo[item.value] }}</div>
          </div>
        </div>
        <div class="retrospect_content_title">
          管片信息
        </div>
        <div class="retrospect_content_title">管片信息</div>
        <div class="retrospect_content_table">
          <div
            class="table_item"
            :style="{width: `calc(100% / ${asyncDuctpieceInfo.length})`}"
          <div
            class="table_item"
            :style="{ width: `calc(100% / ${asyncDuctpieceInfo.length})` }"
            v-for="item in asyncDuctpieceInfo"
            :key="item.id">
            <div class="table_item_chunk table_th">{{item.label}}</div>
            <div class="table_item_chunk table_td">{{retrospectInfo[item.value]}}</div>
            :key="item.id"
          >
            <div class="table_item_chunk table_th">{{ item.label }}</div>
            <div class="table_item_chunk table_td">{{ retrospectInfo[item.value] }}</div>
          </div>
        </div>
      </div>
@@ -261,329 +354,612 @@
      class="prop_dialog"
      :title="asyncTitle ? '新增管片' : '修改环号'"
      :visible.sync="asyncInsert"
      width="35%">
      <el-form ref="formInsert" :model="formInsert" :rules="rulesInsert" label-width="auto" class="rule_form">
        <el-form-item label="项目名称:" prop="proId" v-if="asyncTtile">
          <el-select v-model="formInsert.proId" clearable placeholder="请选择项目信息" @change="getAllSteelPipeData">
      width="35%"
    >
      <el-form
        ref="formInsert"
        :model="formInsert"
        :rules="rulesInsert"
        label-width="auto"
        class="rule_form"
      >
        <el-form-item label="项目名称:" prop="proId" v-if="asyncTitle">
          <el-select
            v-model="formInsert.proId"
            clearable
            placeholder="请选择项目信息"
            @change="getAllSteelPipeData"
          >
            <el-option
              v-for="item in projectData"
              :key="item.proId"
              :label="item.proName"
              :value="item.proId">
              :value="item.proId"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="配筋:" prop="reinforcementId" v-if="asyncTitle">
          <el-select
            v-model="formInsert.reinforcementId"
            clearable
            placeholder="请选择配筋"
          >
            <el-option
              v-for="item in steelData"
              :key="item.hasSteel"
              :label="item.dictName"
              :value="item.hasSteel"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="环号:" prop="ringNum">
          <el-input v-model="formInsert.ringNum" clearable placeholder="请输入环号"></el-input>
          <el-input
            v-model="formInsert.ringNum"
            clearable
            placeholder="请输入环号"
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer">
        <el-button @click="asyncInsert = false">取 消</el-button>
        <el-button class="submit_btn" @click="asyncTitle ? submitInsertPipe() : submitUpdatePipe()">提 交</el-button>
        <el-button
          class="submit_btn"
          @click="asyncTitle ? submitInsertPipe() : submitUpdatePipe()"
          >提 交</el-button
        >
      </div>
    </el-dialog>
    <el-dialog
      class="prop_dialog"
      title="修改时间"
      :visible.sync="asyncTime"
      width="35%">
      <el-form
        ref="formTime"
        :model="formTime"
        :rules="rulesTime"
        label-width="auto"
        class="rule_form">
        <el-form-item label="入模时间:" prop="inModTime">
          <el-date-picker
            v-model="formTime.inModTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择入模时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="浇筑时间:" prop="pouringTime">
          <el-date-picker
            v-model="formTime.pouringTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择浇筑时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="入窑时间:" prop="placingInTime">
          <el-date-picker
            v-model="formTime.placingInTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择入窑时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="出窑时间:" prop="placingOutTime">
          <el-date-picker
            v-model="formTime.placingOutTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择出窑时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="出模时间:" prop="outModTime">
          <el-date-picker
            v-model="formTime.outModTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择入窑时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="质检时间:" prop="checkTime">
          <el-date-picker
            v-model="formTime.checkTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择质检时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="入水养时间:" prop="inWaterTime" v-if="formTime.inWaterTime">
          <el-date-picker
            v-model="formTime.inWaterTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择入水养时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="出水养时间:" prop="outWaterTime" v-if="formTime.outWaterTime">
          <el-date-picker
            v-model="formTime.outWaterTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择出水养时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="入库时间:" prop="inRepoTime" v-if="formTime.inRepoTime">
          <el-date-picker
            v-model="formTime.inRepoTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择入库时间"
          >
          </el-date-picker>
        </el-form-item>
        <!-- <el-form-item label="出库时间:" prop="intoModTime">
          <el-date-picker
            v-model="formTime.intoModTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择出库时间"
          >
          </el-date-picker>
        </el-form-item> -->
      </el-form>
      <div slot="footer">
        <el-button @click="asyncTime = false">取 消</el-button>
        <el-button
          class="submit_btn"
          @click="submitUpdateTime()"
          >提 交
        </el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { cageInfo, mouldInfo, ductpiedceInfo } from '../file/retrospect';
import { cageInfo, mouldInfo, ductpiedceInfo } from "../file/retrospect";
import { downLoadFile, throttle } from "../../../plugins/public";
import { buttonPinia } from '../../../pinia';
import { downLoadFile, throttle } from '../../../plugins/public';
  export default {
    data() {
      return {
        projectId: '',
        projectData: [],
        ringNum: '', // 环号
        groupId: '', // 班组
        groupData: [], // 班组信息
        checkResult: '', // 质量标注
        reinforcement: '', // 配筋
        reinforcementData: [], // 配筋信息
        groutingHoles: '', // 注浆孔
        groutingHolesData: [], // 注浆孔信息
        blockNum: '', // 块号
        blockNumData: [], // 块号信息
        inModTime: '', // 入模时间
        pouringTime: '', // 浇筑时间
        checkTime: '', // 质检时间
        pageNum: 1,
        pageSize: 10,
        total: 0,
        loading: false,
        ductpieceList: [],
        asyncDuctPiece: false, // 存在问题弹窗
        formDuctPiece: {}, // 表单信息
        rulesDuctPiece: {}, // 表单校验规则
        issueType: '',
        asyncRetrospect: false, // 质量追溯弹窗
        asyncCageInfo: cageInfo, // 钢筋笼信息
        asyncMouldInfo: mouldInfo, // 模具信息
        asyncDuctpieceInfo: ductpiedceInfo, // 管片信息
        retrospectInfo: {},// 质量追溯信息
        pipeId: '',
        checkResultStr: '',
        asyncTitle: true,
        asyncInsert: false,
        formInsert: {},
        rulesInsert: {
          proId: [{
export default {
  data() {
    // const validatePass = (rule, value, callback) => {
    //   if(value === '') {
    //     callback(new Error('请再次输入密码'));
    //   } else if(value < ) {
    //   } else {
    //     callback();
    //   }
    // }
    return {
      projectId: "",
      projectData: [],
      ringNum: "", // 环号
      groupId: "", // 班组
      groupData: [], // 班组信息
      checkResult: "", // 质量标注
      reinforcement: "", // 配筋
      reinforcementData: [], // 配筋信息
      groutingHoles: "", // 注浆孔
      groutingHolesData: [], // 注浆孔信息
      blockNum: "", // 块号
      blockNumData: [], // 块号信息
      inModTime: "", // 入模时间
      pouringTime: "", // 浇筑时间
      checkTime: "", // 质检时间
      pageNum: 1,
      pageSize: 10,
      total: 0,
      loading: false,
      ductpieceList: [],
      asyncDuctPiece: false, // 存在问题弹窗
      formDuctPiece: {}, // 表单信息
      rulesDuctPiece: {}, // 表单校验规则
      issueType: "",
      asyncRetrospect: false, // 质量追溯弹窗
      asyncCageInfo: cageInfo, // 钢筋笼信息
      asyncMouldInfo: mouldInfo, // 模具信息
      asyncDuctpieceInfo: ductpiedceInfo, // 管片信息
      retrospectInfo: {}, // 质量追溯信息
      fileList: [],
      pipeId: "",
      checkResultStr: "",
      asyncTitle: true,
      asyncInsert: false,
      formInsert: {},
      rulesInsert: {
        proId: [
          {
            required: true,
            message: '请选择项目名称',
            trigger: 'blur'
          }],
          ringNum: [{
            message: "请选择项目名称",
            trigger: ["blur", "change"],
          },
        ],
        reinforcementId: [
          {
            required: true,
            message: '请输入环号',
            trigger: 'blur'
          }],
        },
        proData: [],
        steelData: [],
        mouldData: [],
            message: "请选择配筋",
            trigger: ["blur", "change"],
          },
        ],
        ringNum: [
          {
            required: true,
            message: "请输入环号",
            trigger: "blur",
          },
        ]
      },
      proData: [],
      steelData: [],
      mouldData: [],
      changeTime: false,
      asyncTime: false,
      formTime: {},
      rulesTime: {
        inModTime: [{
          required: true,
          message: "请选择入模时间",
          trigger: ["blur", "change"],
        }],
        outModTime: [{
          required: true,
          message: "请选择出模时间",
          trigger: ["blur", "change"],
        }],
        pouringTime: [{
          required: true,
          message: "请选择浇筑时间",
          trigger: ["blur", "change"],
        }],
        placingInTime: [{
          required: true,
          message: "请选择入窑时间",
          trigger: ["blur", "change"],
        }],
        placingOutTime: [{
          required: true,
          message: "请选择出窑时间",
          trigger: ["blur", "change"],
        }],
        checkTime: [{
          required: true,
          message: "请选择质检时间",
          trigger: ["blur", "change"],
        }],
        inWaterTime: [{
          required: true,
          message: "请选择入池时间",
          trigger: ["blur", "change"],
        }],
        outWaterTime: [{
          required: true,
          message: "请选择出池时间",
          trigger: ["blur", "change"],
        }],
        inRepoTime: [{
          required: true,
          message: "请选择入库时间",
          trigger: ["blur", "change"],
        }]
      }
    };
  },
  mounted() {
    this.getAllProjects();
    this.getAllGroupData();
    this.searchDuctpiecePLMList(true);
  },
  methods: {
    // 根据项目获取钢筋笼 模具信息
    async getAllSteelPipeData(proId) {
      if (proId) {
        this.steelData = [];
        const { data } = await this.$api.Basics.getProjectSystemInfoData({
          proId: proId,
        });
        this.steelData = data.proHas;
      } else {
        this.$set(this.formInsert, "reinforcementId", "");
        this.steelData = [];
      }
    },
    mounted() {
      this.getAllProjects();
      this.getAllGroupData();
      this.searchDuctpiecePLMList(true);
    // 获取全部班组
    async getAllGroupData() {
      const { data } = await this.$api.DuctpiecePLM.getAllGroupData();
      this.groupData = data;
    },
    methods: {
      // 根据项目获取钢筋笼 模具信息
      async getAllSteelPipeData(proId) {
        this.steelData = [];
        this.mouldData = [];
        const { data } = await this.$api.DuctpiecePLM.getAllSteelPipeData({
          proId: proId
        });
        this.steelData = data.steel;
        this.mouldData = data.mod;
      },
      // 获取全部班组
      async getAllGroupData() {
        const { data } = await this.$api.DuctpiecePLM.getAllGroupData();
        this.groupData = data;
      },
      // 获取全部项目
      async getAllProjects() {
        const { data } = await this.$api.Engineer.getAllProjects();
        this.projectData = data;
      },
      // 查询管片信息
      searchDuctpiecePLMList(bol) {
        if(bol) {
          this.pageNum = 1;
        }
        this.loading = true;
        this.ductpieceList = [];
        this.$api.DuctpiecePLM.searchDuctpiecePLMList({
          pageNum: this.pageNum,
          pageSize: this.pageSize,
          proId: this.projectId,
          ringNum: this.ringNum,
          groupId: this.groupId,
          checkResult: this.checkResult,
          reinforcement: this.reinforcement,
          groutingHoles: this.groutingHoles,
          blockNum: this.blockNum,
          inModStartTime: this.inModTime ? this.inModTime[0] + ' 00:00:00' : '',
          inModEndTime: this.inModTime ? this.inModTime[1] + ' 23:59:59' : '',
          pouringStartTime: this.pouringTime ? this.pouringTime[0] + ' 00:00:00' : '',
          pouringEndTime: this.pouringTime ? this.pouringTime[1] + ' 23:59:59' : '',
          checkStartTime: this.checkTime ? this.checkTime[0] + ' 00:00:00' : '',
          checkEndTime: this.checkTime ? this.checkTime[1] + ' 23:59:59' : ''
        }).then((res) => {
          if(res.success) {
    // 获取全部项目
    async getAllProjects() {
      const { data } = await this.$api.Engineer.getAllProjects();
      this.projectData = data;
    },
    // 查询管片信息
    searchDuctpiecePLMList(bol) {
      if (bol) {
        this.pageNum = 1;
      }
      this.loading = true;
      this.ductpieceList = [];
      this.$api.DuctpiecePLM.searchDuctpiecePLMList({
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        proId: this.projectId,
        ringNum: this.ringNum,
        groupId: this.groupId,
        checkResult: this.checkResult,
        reinforcement: this.reinforcement,
        groutingHoles: this.groutingHoles,
        blockNum: this.blockNum,
        inModStartTime: this.inModTime ? this.inModTime[0] + " 00:00:00" : "",
        inModEndTime: this.inModTime ? this.inModTime[1] + " 23:59:59" : "",
        pouringStartTime: this.pouringTime ? this.pouringTime[0] + " 00:00:00" : "",
        pouringEndTime: this.pouringTime ? this.pouringTime[1] + " 23:59:59" : "",
        checkStartTime: this.checkTime ? this.checkTime[0] + " 00:00:00" : "",
        checkEndTime: this.checkTime ? this.checkTime[1] + " 23:59:59" : "",
      })
        .then((res) => {
          if (res.success) {
            this.total = res.data.total;
            this.ductpieceList = res.data.list;
          }
          this.loading = false;
        }).catch(() => {
        })
        .catch(() => {
          this.loading = false;
        })
      },
      // 打开新增管片信息
      propInsert() {
        this.asyncTitle = true;
        this.asyncInsert = true;
        this.getAllProjects();
      },
      // 打开修改环号信息
      propUpdate(row) {
        this.asyncTitle = false;
        this.asyncInsert = true;
        this.$set(this.formInsert, 'pipeNum', row.pipeNum);
        this.$set(this.formInsert, 'ringNum', row.ringNum);
      },
      // 导出Excel
      exportExcel() {
        this.$api.System.GETEXPORTTOKENDATA({
          ringNum: this.ringNum,
          groupId: this.groupId,
          checkResult: this.checkResult,
          reinforcement: this.reinforcement,
          groutingHoles: this.groutingHoles,
          blockNum: this.blockNum,
          inModStartTime: this.inModTime[0],
          inModEndTime: this.inModTime[1],
          pouringStartTime: this.pouringTime[0],
          pouringEndTime: this.pouringTime[1],
          checkStartTime: this.checkTime[0],
          checkEndTime: this.checkTime[1]
        }).then((res) => {
          if(res.success) {
            downLoadFile(res.data, '/m/pipeInfo/export');
          }
        })
      },
      // 打开存在问题
      propIssue(row) {
        this.pipeId = row.pipeId
        this.checkResultStr = row.checkResultStr;
        this.issueType = row.type;
        this.asyncDuctPiece = true;
        this.$api.DuctpiecePLM.getProblemInfo({
          pipeId: row.pipeId
        }).then((res) => {
          if(res.success) {
            this.$set(this.formDuctPiece, 'pipeCheckId', res.data.pipeCheckId);
            this.$set(this.formDuctPiece, 'existProblem', res.data.existProblem);
            this.$set(this.formDuctPiece, 'exeProResult', res.data.exeProResult);
            this.$set(this.formDuctPiece, 'exeProNote', res.data.exeProNote);
            this.fileList = res.data.files.map((item, index) => {
              return {
                id: index + 1,
                url: `https://szpipe.thhy-tj.com/${item}`
              }
            })
          }
        })
      },
      // 打开质量追溯
      propCheckHistory(row) {
        this.asyncRetrospect = true;
        this.retrospectInfo = {};
        this.$api.DuctpiecePLM.getCheckHistoryInfo({
          pipeId: row.pipeId
        }).then((res) => {
          if(res.success) {
            this.retrospectInfo = res.data;
          }
        })
      },
      // 提交存在问题
      submitInsertForm: throttle(function() {
        const params = Object.assign({}, this.formDuctPiece);
        params.checkResultStr = this.checkResultStr;
        params.pipeId = this.pipeId;
        this.$api.DuctpiecePLM.insertIssueInfo(params).then((res) => {
          if(res.success) {
            this.asyncDuctPiece = false;
            this.searchDuctpiecePLMList(true);
            this.$message.success('添加成功!');
          } else {
            this.$message.warning(res.statusMsg);
          }
        })
      }, 3000),
      // 提交新增管片信息
      submitInsertPipe: throttle(function() {
        this.$refs.formInsert.validate((valid) => {
          if(valid) {
            const params = Object.assign({}, this.formInsert);
            this.$api.DuctpiecePLM.insertPipeData(params).then((res) => {
              if(res.statusMsg === 'ok') {
                this.asyncInsert = false;
                this.searchDuctpiecePLMList(true);
                this.$message.success('新增成功!');
              } else {
                this.$message.warning(res.statusMsg);
              }
            })
          }
        })
      }, 3000),
      // 提交修改环号信息
      submitUpdatePipe: throttle(function() {
        this.$refs.formInsert.validate((valid) => {
          if(valid) {
            const params = Object.assign({}, this.formInsert);
            this.$api.DuctpiecePLM.updataRingNumData(params).then((res) => {
              if(res.statusMsg === 'ok') {
                this.asyncInsert = false;
                this.searchDuctpiecePLMList(true);
                this.$message.success('修改成功!');
              } else {
                this.$message.warning(res.statusMsg);
              }
            })
          }
        })
      }, 3000),
      //
      showCheckResult(value) {
        return !value ? '' : value == 1 ? '合格' : '存在问题';
      },
      // 根据项目获取尺寸 配筋 块号信息
      changeHeaderProject(data) {
          this.blockNum = '';
          this.reinforcement = '';
          this.groutingHoles = '';
          this.groutingHolesData = [];
          this.blockNumData = [];
          this.reinforcementData = [];
        if(data) {
          this.$api.Basics.getProjectSystemInfoData({
            proId: data
          }).then((res) => {
            this.groutingHolesData = res.data.proGroutings;
            this.blockNumData = res.data.proBloks;
            this.reinforcementData = res.data.proHas;
          })
        }
      },
      // 切换页数
      changePageNum(page) {
        this.pageNum = page;
        this.searchDuctpiecePLMList();
      },
      // 切换每页条数
      changePageSize(size) {
        this.pageSize = size;
        this.searchDuctpiecePLMList();
      },
      // 判断按钮权限信息
      showButton(str) {
        const pinia = buttonPinia();
        return pinia.$state.buttonInfo.includes(str);
      },
        });
    },
    watch: {
      asyncDuctpieceInfo(bol) {
        if(!bol) {
          this.formDuctPiece = {};
          this.pipeId = '';
          this.checkResultStr = '';
          this.fileList = [];
    // 打开新增管片信息
    propInsert() {
      this.asyncTitle = true;
      this.asyncInsert = true;
      this.getAllProjects();
    },
    // 打开修改环号信息
    propUpdate(row) {
      this.asyncTitle = false;
      this.asyncInsert = true;
      this.$set(this.formInsert, "pipeNum", row.pipeNum);
      this.$set(this.formInsert, "ringNum", row.ringNum);
    },
    // 打开修改时间
    propUpdateTime(row) {
      this.asyncTime = true;
      this.$set(this.formTime, "pipeNum", row.pipeNum);
      this.$set(this.formTime, "ringNum", row.ringNum);
      this.$api.DuctpiecePLM.getPipeTimeData({
        pipeNum: row.pipeNum
      }).then(res => {
        if(res.success) {
          this.$set(this.formTime, 'inModTime', res.data.inModTime);
          this.$set(this.formTime, 'outModTime', res.data.outModTime);
          this.$set(this.formTime, 'pouringTime', res.data.pouringTime);
          this.$set(this.formTime, 'placingInTime', res.data.placingInTime);
          this.$set(this.formTime, 'placingOutTime', res.data.placingOutTime);
          this.$set(this.formTime, 'checkTime', res.data.checkTime);
          if(res.data.inWaterFlag) {
            this.$set(this.formTime, 'inWaterTime', res.data.inWaterTime);
          }
          if(res.data.OutWaterFlag) {
            this.$set(this.formTime, 'outWaterTime', res.data.outWaterTime);
          }
          if(res.data.inRepoFlag) {
            this.$set(this.formTime, 'inRepoTime', res.data.inRepoTime);
          }
          // this.$set(this.formInsert, '', res.data.);
        } else {
         this.$message.warning(res.statusMsg);
        }
      },
      asyncInsert(bol) {
        if(!bol) {
          this.steelData = [];
          this.mouldData = [];
          this.formInsert = {};
          this.$refs.formInsert.resetFields();
      })
    },
    // 导出Excel
    exportExcel() {
      this.$api.System.GETEXPORTTOKENDATA({
        ringNum: this.ringNum,
        groupId: this.groupId,
        checkResult: this.checkResult,
        reinforcement: this.reinforcement,
        groutingHoles: this.groutingHoles,
        blockNum: this.blockNum,
        inModStartTime: this.inModTime[0],
        inModEndTime: this.inModTime[1],
        pouringStartTime: this.pouringTime[0],
        pouringEndTime: this.pouringTime[1],
        checkStartTime: this.checkTime[0],
        checkEndTime: this.checkTime[1],
      }).then((res) => {
        if (res.success) {
          downLoadFile(res.data, "/m/pipeInfo/export");
        }
      });
    },
    // 打开存在问题
    propIssue(row) {
      this.pipeId = row.pipeId;
      this.checkResultStr = row.checkResultStr;
      this.issueType = row.type;
      this.asyncDuctPiece = true;
      this.$api.DuctpiecePLM.getProblemInfo({
        pipeId: row.pipeId,
      }).then((res) => {
        if (res.success) {
          this.$set(this.formDuctPiece, "pipeCheckId", res.data.pipeCheckId);
          this.$set(this.formDuctPiece, "existProblem", res.data.existProblem);
          this.$set(this.formDuctPiece, "exeProResult", res.data.exeProResult);
          this.$set(this.formDuctPiece, "exeProNote", res.data.exeProNote);
          this.fileList = res.data.files.map((item, index) => {
            return {
              id: index + 1,
              url: `https://pipe.thhy-tj.com/${item}`,
            };
          });
        }
      });
    },
    // 打开质量追溯
    propCheckHistory(row) {
      this.asyncRetrospect = true;
      this.retrospectInfo = {};
      this.$api.DuctpiecePLM.getCheckHistoryInfo({
        pipeId: row.pipeId,
      }).then((res) => {
        if (res.success) {
          this.retrospectInfo = res.data;
        }
      });
    },
    // 提交存在问题
    submitInsertForm: throttle(function () {
      const params = Object.assign({}, this.formDuctPiece);
      params.checkResultStr = this.checkResultStr;
      params.pipeId = this.pipeId;
      this.$api.DuctpiecePLM.insertIssueInfo(params).then((res) => {
        if (res.success) {
          this.asyncDuctPiece = false;
          this.searchDuctpiecePLMList(true);
          this.$message.success("添加成功!");
        } else {
          this.$message.warning(res.statusMsg);
        }
      });
    }, 3000),
    // 提交新增管片信息
    submitInsertPipe: throttle(function () {
      this.$refs.formInsert.validate((valid) => {
        if (valid) {
          const params = Object.assign({}, this.formInsert);
          this.$api.DuctpiecePLM.insertPipeData(params).then((res) => {
            if (res.statusMsg === "ok") {
              this.asyncInsert = false;
              this.searchDuctpiecePLMList(true);
              this.$message.success("新增成功!");
            } else {
              this.$message.warning(res.statusMsg);
            }
          });
        }
      });
    }, 3000),
    // 提交修改环号信息
    submitUpdatePipe: throttle(function () {
      this.$refs.formInsert.validate((valid) => {
        if (valid) {
          const params = Object.assign({}, this.formInsert);
          this.$api.DuctpiecePLM.updataRingNumData(params).then((res) => {
            if (res.statusMsg === "ok") {
              this.asyncInsert = false;
              this.searchDuctpiecePLMList(true);
              this.$message.success("修改成功!");
            } else {
              this.$message.warning(res.statusMsg);
            }
          });
        }
      });
    }, 3000),
    // 提交修改时间信息
    submitUpdateTime: throttle(function() {
      this.$refs.formTime.validate((valid) => {
        if(valid) {
          const params = Object.assign({}, this.formTime);
          this.$api.DuctpiecePLM.updatePipeTimeData(params).then((res) => {
            if (res.statusMsg === "ok") {
              this.asyncTime = false;
              this.searchDuctpiecePLMList(true);
              this.$message.success("修改成功!");
            } else {
              this.$message.warning(res.statusMsg);
            }
          });
        }
      })
    }, 3000),
    //
    showCheckResult(value) {
      return !value ? "" : value == 1 ? "合格" : "存在问题";
    },
    // 根据项目获取尺寸 配筋 块号信息
    changeHeaderProject(data) {
      this.blockNum = "";
      this.reinforcement = "";
      this.groutingHoles = "";
      this.groutingHolesData = [];
      this.blockNumData = [];
      this.reinforcementData = [];
      if (data) {
        this.$api.Basics.getProjectSystemInfoData({
          proId: data,
        }).then((res) => {
          this.groutingHolesData = res.data.proGroutings;
          this.blockNumData = res.data.proBloks;
          this.reinforcementData = res.data.proHas;
        });
      }
    },
    // 转换毫秒
    transitionMsec(time) {
      let msec = 0;
      const date = Date.parse(new Date(time));
      console.log(date,'==-=-=-')
      return msec;
    },
    // 切换页数
    changePageNum(page) {
      this.pageNum = page;
      this.searchDuctpiecePLMList();
    },
    // 切换每页条数
    changePageSize(size) {
      this.pageSize = size;
      this.searchDuctpiecePLMList();
    },
    // 判断按钮权限信息
    showButton(str) {
      const pinia = buttonPinia();
      return pinia.$state.buttonInfo.includes(str);
    },
  },
  watch: {
    asyncDuctpieceInfo(bol) {
      if (!bol) {
        this.formDuctPiece = {};
        this.pipeId = "";
        this.checkResultStr = "";
        this.fileList = [];
      }
    },
    asyncInsert(bol) {
      if (!bol) {
        this.steelData = [];
        this.formInsert = {};
        this.$refs.formInsert.resetFields();
      }
    },
    asyncTime(bol) {
      if(!bol) {
        this.formTime = {};
        this.$refs.formTime.resetFields();
      }
    }
  }
  },
};
</script>
<style lang="scss" scoped>
@import '../../../style/layout-main.scss';
@import "../../../style/layout-main.scss";
.issue_status {
  color: #F42829;
  color: #f42829;
}
.retrospect_content {
@@ -594,7 +970,7 @@
    padding: 0 15px 15px;
    font-size: 16px;
    font-weight: 600;
    color: #FFF;
    color: #fff;
    border-bottom: 1px solid #0d5274;
    &::before {
@@ -605,7 +981,7 @@
      transform: translateY(-85%);
      width: 3px;
      height: 50%;
      background: #18F6F8;
      background: #18f6f8;
    }
  }
@@ -614,22 +990,22 @@
    margin: 10px 10px 10px 0;
    .table_item {
      border: 1px solid #1CB7E0;
      border: 1px solid #1cb7e0;
      border-right: none;
      &:last-child {
        border-right: 1px solid #1CB7E0;
        border-right: 1px solid #1cb7e0;
      }
      .table_item_chunk {
        padding: 10px;
        color: #18F6F8;
        color: #18f6f8;
        text-align: center;
      }
      .table_th {
        border-bottom: 1px solid #1CB7E0;
        background: #082F57;
        border-bottom: 1px solid #1cb7e0;
        background: #082f57;
      }
    }
  }
@@ -649,4 +1025,4 @@
::v-deep .el-date-editor .el-range-separator {
  color: #fff !important;
}
</style>
</style>
web/src/views/DuctpiecePLM/DuctpieceIndex.vue
@@ -3,12 +3,18 @@
    <div class="main_header">
      <div class="header_item">
        <span class="header_label">项目名称:</span>
        <el-select v-model="projectId" clearable placeholder="请选择项目" @change="changeHeaderProject">
        <el-select
          v-model="projectId"
          clearable
          placeholder="请选择项目"
          @change="changeHeaderProject"
        >
          <el-option
            v-for="item in projectData"
            :key="item.proId"
            :label="item.proName"
            :value="item.proId">
            :value="item.proId"
          >
          </el-option>
        </el-select>
      </div>
@@ -23,7 +29,8 @@
            v-for="item in groupData"
            :key="item.groupId"
            :label="item.groupName"
            :value="item.groupId">
            :value="item.groupId"
          >
          </el-option>
        </el-select>
      </div>
@@ -42,7 +49,8 @@
            v-for="item in reinforcementData"
            :key="item.hasSteel"
            :label="item.dictName"
            :value="item.hasSteel">
            :value="item.hasSteel"
          >
          </el-option>
        </el-select>
      </div>
@@ -53,9 +61,10 @@
            v-for="item in groutingHolesData"
            :key="item.groutingHoles"
            :label="item.dictName"
            :value="item.groutingHoles">
            :value="item.groutingHoles"
          >
          </el-option>
        </el-select>
        </el-select>
      </div>
      <div class="header_item">
        <span class="header_label">块号:</span>
@@ -64,7 +73,8 @@
            v-for="item in blockNumData"
            :key="item.blockNum"
            :label="item.dictName"
            :value="item.blockNum">
            :value="item.blockNum"
          >
          </el-option>
        </el-select>
      </div>
@@ -76,7 +86,8 @@
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          value-format="yyyy-MM-dd">
          value-format="yyyy-MM-dd"
        >
        </el-date-picker>
      </div>
      <!-- <div class="header_item">
@@ -98,51 +109,119 @@
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          value-format="yyyy-MM-dd">
          value-format="yyyy-MM-dd"
        >
        </el-date-picker>
      </div>
      <div class="header_item">
        <el-button v-if="showButton('search')" icon="el-icon-search" @click="searchDuctpiecePLMList(true)">查询</el-button>
        <el-button v-if="showButton('insert')" icon="el-icon-download" @click="propInsert()">新增管片</el-button>
        <el-button v-if="showButton('insert')" icon="el-icon-download" @click="exportExcel()">导出Excel</el-button>
        <el-button
          v-if="showButton('search')"
          icon="el-icon-search"
          @click="searchDuctpiecePLMList(true)"
          >查询</el-button
        >
        <el-button
          v-if="showButton('insert')"
          icon="el-icon-download"
          @click="propInsert()"
          >新增管片</el-button
        >
        <el-button
          v-if="showButton('export')"
          icon="el-icon-download"
          @click="exportExcel()"
          >导出Excel</el-button
        >
      </div>
    </div>
    <div class="main_content">
      <el-table
        v-loading="loading"
        :data="ductpieceList"
        height="100%">
      <el-table v-loading="loading" :data="ductpieceList" height="100%">
        <el-table-column label="序号" width="60" align="center">
          <template #default="scope">
            <span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span>
            <span>{{ (pageNum - 1) * pageSize + scope.$index + 1 }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="ringNum" label="环号" align="center"></el-table-column>
        <el-table-column prop="proName" label="项目名称" align="center"></el-table-column>
        <el-table-column prop="pipeNum" label="管片编号" align="center"></el-table-column>
        <el-table-column prop="turnName" label="转向" align="center"></el-table-column>
        <el-table-column prop="reinforcementName" label="配筋" align="center"></el-table-column>
        <el-table-column prop="groutingHolesName" label="注浆孔" align="center"></el-table-column>
        <el-table-column prop="blockNumName" label="块号" align="center"></el-table-column>
        <el-table-column
          prop="reinforcementName"
          label="配筋"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="groutingHolesName"
          label="注浆孔"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="blockNumName"
          label="块号"
          align="center"
        ></el-table-column>
        <el-table-column prop="mouldNum" label="模具" align="center"></el-table-column>
        <el-table-column prop="intoModTime" label="入模时间" align="center"></el-table-column>
        <el-table-column
          prop="intoModTime"
          label="入模时间"
          align="center"
        ></el-table-column>
        <!-- <el-table-column prop="pouringTime" label="浇筑时间" align="center"></el-table-column> -->
        <el-table-column prop="checkTime" label="质检时间" align="center"></el-table-column>
        <el-table-column prop="groupName" label="生产班组" align="center"></el-table-column>
        <el-table-column
          prop="checkTime"
          label="质检时间"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="groupName"
          label="生产班组"
          align="center"
        ></el-table-column>
        <el-table-column label="质量标注" align="center">
          <template #default="{ row }">
            <div>
               {{ row.checkResult == 0 ? '未质检' : row.checkResult == 1 ? '合格' : row.checkResult == 2 ? '不合格' : row.checkResult == 3 ? '报废' : ''}}
              {{
                row.checkResult == 0
                  ? "未质检"
                  : row.checkResult == 1
                  ? "合格"
                  : row.checkResult == 2
                  ? "不合格"
                  : row.checkResult == 3
                  ? "报废"
                  : ""
              }}
            </div>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" width="300">
          <template #default="{ row }">
            <template v-if="showButton('update') && row.checkResult !== 1">
              <el-button class="table_btn" size="mini" @click="propIssue(row)">存在问题</el-button>
            <template v-if="showButton('update') && [2, 3].includes(row.checkResult)">
              <el-button class="table_btn" size="mini" @click="propIssue(row)"
                >存在问题</el-button
              >
            </template>
            <el-button class="table_btn" size="mini" v-if="showButton('update') && row.checkResult == 0" @click="propUpdate(row)">修改环号</el-button>
            <el-button class="table_btn" size="mini" v-if="showButton('delete')" @click="propCheckHistory(row)">质量追溯</el-button>
            <el-button
              class="table_btn"
              size="mini"
              v-if="showButton('update')"
              @click="propUpdate(row)"
              >修改环号</el-button
            >
            <el-button
              class="table_btn"
              size="mini"
              v-if="showButton('update')"
              @click="propUpdateTime(row)"
              >修改时间</el-button
            >
            <el-button
              class="table_btn"
              size="mini"
              v-if="showButton('delete')"
              @click="propCheckHistory(row)"
              >质量追溯</el-button
            >
          </template>
        </el-table-column>
      </el-table>
@@ -156,24 +235,33 @@
        :page-sizes="[10, 20, 50, 100]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total">
        :total="total"
      >
      </el-pagination>
    </div>
    <el-dialog
      class="prop_dialog"
      title="存在问题"
      :visible.sync="asyncDuctPiece"
      width="35%">
      <el-form ref="form" :model="formDuctPiece" :rules="rulesDuctPiece" label-width="auto" class="rule_form">
      width="35%"
    >
      <el-form
        ref="form"
        :model="formDuctPiece"
        :rules="rulesDuctPiece"
        label-width="auto"
        class="rule_form"
      >
        <el-form-item label="质检结果:">
          <span class="issue_status">{{checkResultStr}}</span>
          <span class="issue_status">{{ checkResultStr }}</span>
        </el-form-item>
        <el-form-item label="存在问题:">
          <el-input
            v-model="formDuctPiece.existProblem"
          <el-input
            v-model="formDuctPiece.existProblem"
            type="textarea"
            disabled
            placeholder="请输入存在问题"></el-input>
            placeholder="请输入存在问题"
          ></el-input>
        </el-form-item>
        <el-form-item label="问题图片:">
          <div class="problem_content">
@@ -181,25 +269,28 @@
              v-for="item in fileList"
              :key="item.id"
              class="problem_image"
              :src="item.url">
              :src="item.url"
            >
            </el-image>
          </div>
        </el-form-item>
        <el-form-item label="问题处理结果:">
          <el-input
            v-model="formDuctPiece.exeProResult"
          <el-input
            v-model="formDuctPiece.exeProResult"
            type="textarea"
            clearable
            placeholder="请输入问题处理结果"></el-input>
            clearable
            placeholder="请输入问题处理结果"
          ></el-input>
        </el-form-item>
        <el-form-item label="备注:">
          <el-input
            v-model="formDuctPiece.exeProNote"
          <el-input
            v-model="formDuctPiece.exeProNote"
            type="textarea"
            clearable
            clearable
            placeholder="请输入备注"
            maxlength="200"
            show-word-limit></el-input>
            show-word-limit
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer">
@@ -212,47 +303,49 @@
      class="prop_dialog"
      title="质量追溯"
      :visible.sync="asyncRetrospect"
      width="70%">
      width="70%"
    >
      <div class="retrospect_content">
        <div class="retrospect_content_title">
          钢筋笼信息
        </div>
        <div class="retrospect_content_title">钢筋笼信息</div>
        <div class="retrospect_content_table">
          <div
            class="table_item"
            :style="{width: `calc(100% / ${asyncCageInfo.length})`}"
          <div
            class="table_item"
            :style="{ width: `calc(100% / ${asyncCageInfo.length})` }"
            v-for="item in asyncCageInfo"
            :key="item.id">
            <div class="table_item_chunk table_th">{{item.label}}</div>
            <div class="table_item_chunk table_td">{{
              item.value === 'steelCheckResult' ? showCheckResult(retrospectInfo[item.value]) : retrospectInfo[item.value]}}
            :key="item.id"
          >
            <div class="table_item_chunk table_th">{{ item.label }}</div>
            <div class="table_item_chunk table_td">
              {{
                item.value === "steelCheckResult"
                  ? showCheckResult(retrospectInfo[item.value])
                  : retrospectInfo[item.value]
              }}
            </div>
          </div>
        </div>
        <div class="retrospect_content_title">
          模具信息
        </div>
        <div class="retrospect_content_title">模具信息</div>
        <div class="retrospect_content_table">
          <div
            class="table_item"
            :style="{width: `calc(100% / ${asyncMouldInfo.length})`}"
          <div
            class="table_item"
            :style="{ width: `calc(100% / ${asyncMouldInfo.length})` }"
            v-for="item in asyncMouldInfo"
            :key="item.id">
            <div class="table_item_chunk table_th">{{item.label}}</div>
            <div class="table_item_chunk table_td">{{retrospectInfo[item.value]}}</div>
            :key="item.id"
          >
            <div class="table_item_chunk table_th">{{ item.label }}</div>
            <div class="table_item_chunk table_td">{{ retrospectInfo[item.value] }}</div>
          </div>
        </div>
        <div class="retrospect_content_title">
          管片信息
        </div>
        <div class="retrospect_content_title">管片信息</div>
        <div class="retrospect_content_table">
          <div
            class="table_item"
            :style="{width: `calc(100% / ${asyncDuctpieceInfo.length})`}"
          <div
            class="table_item"
            :style="{ width: `calc(100% / ${asyncDuctpieceInfo.length})` }"
            v-for="item in asyncDuctpieceInfo"
            :key="item.id">
            <div class="table_item_chunk table_th">{{item.label}}</div>
            <div class="table_item_chunk table_td">{{retrospectInfo[item.value]}}</div>
            :key="item.id"
          >
            <div class="table_item_chunk table_th">{{ item.label }}</div>
            <div class="table_item_chunk table_td">{{ retrospectInfo[item.value] }}</div>
          </div>
        </div>
      </div>
@@ -261,329 +354,612 @@
      class="prop_dialog"
      :title="asyncTitle ? '新增管片' : '修改环号'"
      :visible.sync="asyncInsert"
      width="35%">
      <el-form ref="formInsert" :model="formInsert" :rules="rulesInsert" label-width="auto" class="rule_form">
        <el-form-item label="项目名称:" prop="proId" v-if="asyncTtile">
          <el-select v-model="formInsert.proId" clearable placeholder="请选择项目信息" @change="getAllSteelPipeData">
      width="35%"
    >
      <el-form
        ref="formInsert"
        :model="formInsert"
        :rules="rulesInsert"
        label-width="auto"
        class="rule_form"
      >
        <el-form-item label="项目名称:" prop="proId" v-if="asyncTitle">
          <el-select
            v-model="formInsert.proId"
            clearable
            placeholder="请选择项目信息"
            @change="getAllSteelPipeData"
          >
            <el-option
              v-for="item in projectData"
              :key="item.proId"
              :label="item.proName"
              :value="item.proId">
              :value="item.proId"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="配筋:" prop="reinforcementId" v-if="asyncTitle">
          <el-select
            v-model="formInsert.reinforcementId"
            clearable
            placeholder="请选择配筋"
          >
            <el-option
              v-for="item in steelData"
              :key="item.hasSteel"
              :label="item.dictName"
              :value="item.hasSteel"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="环号:" prop="ringNum">
          <el-input v-model="formInsert.ringNum" clearable placeholder="请输入环号"></el-input>
          <el-input
            v-model="formInsert.ringNum"
            clearable
            placeholder="请输入环号"
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer">
        <el-button @click="asyncInsert = false">取 消</el-button>
        <el-button class="submit_btn" @click="asyncTitle ? submitInsertPipe() : submitUpdatePipe()">提 交</el-button>
        <el-button
          class="submit_btn"
          @click="asyncTitle ? submitInsertPipe() : submitUpdatePipe()"
          >提 交</el-button
        >
      </div>
    </el-dialog>
    <el-dialog
      class="prop_dialog"
      title="修改时间"
      :visible.sync="asyncTime"
      width="35%">
      <el-form
        ref="formTime"
        :model="formTime"
        :rules="rulesTime"
        label-width="auto"
        class="rule_form">
        <el-form-item label="入模时间:" prop="inModTime">
          <el-date-picker
            v-model="formTime.inModTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择入模时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="浇筑时间:" prop="pouringTime">
          <el-date-picker
            v-model="formTime.pouringTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择浇筑时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="入窑时间:" prop="placingInTime">
          <el-date-picker
            v-model="formTime.placingInTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择入窑时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="出窑时间:" prop="placingOutTime">
          <el-date-picker
            v-model="formTime.placingOutTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择出窑时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="出模时间:" prop="outModTime">
          <el-date-picker
            v-model="formTime.outModTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择入窑时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="质检时间:" prop="checkTime">
          <el-date-picker
            v-model="formTime.checkTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择质检时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="入水养时间:" prop="inWaterTime" v-if="formTime.inWaterTime">
          <el-date-picker
            v-model="formTime.inWaterTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择入水养时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="出水养时间:" prop="outWaterTime" v-if="formTime.outWaterTime">
          <el-date-picker
            v-model="formTime.outWaterTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择出水养时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="入库时间:" prop="inRepoTime" v-if="formTime.inRepoTime">
          <el-date-picker
            v-model="formTime.inRepoTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择入库时间"
          >
          </el-date-picker>
        </el-form-item>
        <!-- <el-form-item label="出库时间:" prop="intoModTime">
          <el-date-picker
            v-model="formTime.intoModTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder="选择出库时间"
          >
          </el-date-picker>
        </el-form-item> -->
      </el-form>
      <div slot="footer">
        <el-button @click="asyncTime = false">取 消</el-button>
        <el-button
          class="submit_btn"
          @click="submitUpdateTime()"
          >提 交
        </el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { cageInfo, mouldInfo, ductpiedceInfo } from './file/retrospect';
import { cageInfo, mouldInfo, ductpiedceInfo } from "./file/retrospect";
import { downLoadFile, throttle } from "../../plugins/public";
import { buttonPinia } from '../../pinia';
import { downLoadFile, throttle } from '../../plugins/public';
  export default {
    data() {
      return {
        projectId: '',
        projectData: [],
        ringNum: '', // 环号
        groupId: '', // 班组
        groupData: [], // 班组信息
        checkResult: '', // 质量标注
        reinforcement: '', // 配筋
        reinforcementData: [], // 配筋信息
        groutingHoles: '', // 注浆孔
        groutingHolesData: [], // 注浆孔信息
        blockNum: '', // 块号
        blockNumData: [], // 块号信息
        inModTime: '', // 入模时间
        pouringTime: '', // 浇筑时间
        checkTime: '', // 质检时间
        pageNum: 1,
        pageSize: 10,
        total: 0,
        loading: false,
        ductpieceList: [],
        asyncDuctPiece: false, // 存在问题弹窗
        formDuctPiece: {}, // 表单信息
        rulesDuctPiece: {}, // 表单校验规则
        issueType: '',
        asyncRetrospect: false, // 质量追溯弹窗
        asyncCageInfo: cageInfo, // 钢筋笼信息
        asyncMouldInfo: mouldInfo, // 模具信息
        asyncDuctpieceInfo: ductpiedceInfo, // 管片信息
        retrospectInfo: {},// 质量追溯信息
        pipeId: '',
        checkResultStr: '',
        asyncTitle: true,
        asyncInsert: false,
        formInsert: {},
        rulesInsert: {
          proId: [{
export default {
  data() {
    // const validatePass = (rule, value, callback) => {
    //   if(value === '') {
    //     callback(new Error('请再次输入密码'));
    //   } else if(value < ) {
    //   } else {
    //     callback();
    //   }
    // }
    return {
      projectId: "",
      projectData: [],
      ringNum: "", // 环号
      groupId: "", // 班组
      groupData: [], // 班组信息
      checkResult: "", // 质量标注
      reinforcement: "", // 配筋
      reinforcementData: [], // 配筋信息
      groutingHoles: "", // 注浆孔
      groutingHolesData: [], // 注浆孔信息
      blockNum: "", // 块号
      blockNumData: [], // 块号信息
      inModTime: "", // 入模时间
      pouringTime: "", // 浇筑时间
      checkTime: "", // 质检时间
      pageNum: 1,
      pageSize: 10,
      total: 0,
      loading: false,
      ductpieceList: [],
      asyncDuctPiece: false, // 存在问题弹窗
      formDuctPiece: {}, // 表单信息
      rulesDuctPiece: {}, // 表单校验规则
      issueType: "",
      asyncRetrospect: false, // 质量追溯弹窗
      asyncCageInfo: cageInfo, // 钢筋笼信息
      asyncMouldInfo: mouldInfo, // 模具信息
      asyncDuctpieceInfo: ductpiedceInfo, // 管片信息
      retrospectInfo: {}, // 质量追溯信息
      fileList: [],
      pipeId: "",
      checkResultStr: "",
      asyncTitle: true,
      asyncInsert: false,
      formInsert: {},
      rulesInsert: {
        proId: [
          {
            required: true,
            message: '请选择项目名称',
            trigger: 'blur'
          }],
          ringNum: [{
            message: "请选择项目名称",
            trigger: ["blur", "change"],
          },
        ],
        reinforcementId: [
          {
            required: true,
            message: '请输入环号',
            trigger: 'blur'
          }],
        },
        proData: [],
        steelData: [],
        mouldData: [],
            message: "请选择配筋",
            trigger: ["blur", "change"],
          },
        ],
        ringNum: [
          {
            required: true,
            message: "请输入环号",
            trigger: "blur",
          },
        ]
      },
      proData: [],
      steelData: [],
      mouldData: [],
      changeTime: false,
      asyncTime: false,
      formTime: {},
      rulesTime: {
        inModTime: [{
          required: true,
          message: "请选择入模时间",
          trigger: ["blur", "change"],
        }],
        outModTime: [{
          required: true,
          message: "请选择出模时间",
          trigger: ["blur", "change"],
        }],
        pouringTime: [{
          required: true,
          message: "请选择浇筑时间",
          trigger: ["blur", "change"],
        }],
        placingInTime: [{
          required: true,
          message: "请选择入窑时间",
          trigger: ["blur", "change"],
        }],
        placingOutTime: [{
          required: true,
          message: "请选择出窑时间",
          trigger: ["blur", "change"],
        }],
        checkTime: [{
          required: true,
          message: "请选择质检时间",
          trigger: ["blur", "change"],
        }],
        inWaterTime: [{
          required: true,
          message: "请选择入池时间",
          trigger: ["blur", "change"],
        }],
        outWaterTime: [{
          required: true,
          message: "请选择出池时间",
          trigger: ["blur", "change"],
        }],
        inRepoTime: [{
          required: true,
          message: "请选择入库时间",
          trigger: ["blur", "change"],
        }]
      }
    };
  },
  mounted() {
    this.getAllProjects();
    this.getAllGroupData();
    this.searchDuctpiecePLMList(true);
  },
  methods: {
    // 根据项目获取钢筋笼 模具信息
    async getAllSteelPipeData(proId) {
      if (proId) {
        this.steelData = [];
        const { data } = await this.$api.Basics.getProjectSystemInfoData({
          proId: proId,
        });
        this.steelData = data.proHas;
      } else {
        this.$set(this.formInsert, "reinforcementId", "");
        this.steelData = [];
      }
    },
    mounted() {
      this.getAllProjects();
      this.getAllGroupData();
      this.searchDuctpiecePLMList(true);
    // 获取全部班组
    async getAllGroupData() {
      const { data } = await this.$api.DuctpiecePLM.getAllGroupData();
      this.groupData = data;
    },
    methods: {
      // 根据项目获取钢筋笼 模具信息
      async getAllSteelPipeData(proId) {
        this.steelData = [];
        this.mouldData = [];
        const { data } = await this.$api.DuctpiecePLM.getAllSteelPipeData({
          proId: proId
        });
        this.steelData = data.steel;
        this.mouldData = data.mod;
      },
      // 获取全部班组
      async getAllGroupData() {
        const { data } = await this.$api.DuctpiecePLM.getAllGroupData();
        this.groupData = data;
      },
      // 获取全部项目
      async getAllProjects() {
        const { data } = await this.$api.Engineer.getAllProjects();
        this.projectData = data;
      },
      // 查询管片信息
      searchDuctpiecePLMList(bol) {
        if(bol) {
          this.pageNum = 1;
        }
        this.loading = true;
        this.ductpieceList = [];
        this.$api.DuctpiecePLM.searchDuctpiecePLMList({
          pageNum: this.pageNum,
          pageSize: this.pageSize,
          proId: this.projectId,
          ringNum: this.ringNum,
          groupId: this.groupId,
          checkResult: this.checkResult,
          reinforcement: this.reinforcement,
          groutingHoles: this.groutingHoles,
          blockNum: this.blockNum,
          inModStartTime: this.inModTime ? this.inModTime[0] + ' 00:00:00' : '',
          inModEndTime: this.inModTime ? this.inModTime[1] + ' 23:59:59' : '',
          pouringStartTime: this.pouringTime ? this.pouringTime[0] + ' 00:00:00' : '',
          pouringEndTime: this.pouringTime ? this.pouringTime[1] + ' 23:59:59' : '',
          checkStartTime: this.checkTime ? this.checkTime[0] + ' 00:00:00' : '',
          checkEndTime: this.checkTime ? this.checkTime[1] + ' 23:59:59' : ''
        }).then((res) => {
          if(res.success) {
    // 获取全部项目
    async getAllProjects() {
      const { data } = await this.$api.Engineer.getAllProjects();
      this.projectData = data;
    },
    // 查询管片信息
    searchDuctpiecePLMList(bol) {
      if (bol) {
        this.pageNum = 1;
      }
      this.loading = true;
      this.ductpieceList = [];
      this.$api.DuctpiecePLM.searchDuctpiecePLMList({
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        proId: this.projectId,
        ringNum: this.ringNum,
        groupId: this.groupId,
        checkResult: this.checkResult,
        reinforcement: this.reinforcement,
        groutingHoles: this.groutingHoles,
        blockNum: this.blockNum,
        inModStartTime: this.inModTime ? this.inModTime[0] + " 00:00:00" : "",
        inModEndTime: this.inModTime ? this.inModTime[1] + " 23:59:59" : "",
        pouringStartTime: this.pouringTime ? this.pouringTime[0] + " 00:00:00" : "",
        pouringEndTime: this.pouringTime ? this.pouringTime[1] + " 23:59:59" : "",
        checkStartTime: this.checkTime ? this.checkTime[0] + " 00:00:00" : "",
        checkEndTime: this.checkTime ? this.checkTime[1] + " 23:59:59" : "",
      })
        .then((res) => {
          if (res.success) {
            this.total = res.data.total;
            this.ductpieceList = res.data.list;
          }
          this.loading = false;
        }).catch(() => {
        })
        .catch(() => {
          this.loading = false;
        })
      },
      // 打开新增管片信息
      propInsert() {
        this.asyncTitle = true;
        this.asyncInsert = true;
        this.getAllProjects();
      },
      // 打开修改环号信息
      propUpdate(row) {
        this.asyncTitle = false;
        this.asyncInsert = true;
        this.$set(this.formInsert, 'pipeNum', row.pipeNum);
        this.$set(this.formInsert, 'ringNum', row.ringNum);
      },
      // 导出Excel
      exportExcel() {
        this.$api.System.GETEXPORTTOKENDATA({
          ringNum: this.ringNum,
          groupId: this.groupId,
          checkResult: this.checkResult,
          reinforcement: this.reinforcement,
          groutingHoles: this.groutingHoles,
          blockNum: this.blockNum,
          inModStartTime: this.inModTime[0],
          inModEndTime: this.inModTime[1],
          pouringStartTime: this.pouringTime[0],
          pouringEndTime: this.pouringTime[1],
          checkStartTime: this.checkTime[0],
          checkEndTime: this.checkTime[1]
        }).then((res) => {
          if(res.success) {
            downLoadFile(res.data, '/m/pipeInfo/export');
          }
        })
      },
      // 打开存在问题
      propIssue(row) {
        this.pipeId = row.pipeId
        this.checkResultStr = row.checkResultStr;
        this.issueType = row.type;
        this.asyncDuctPiece = true;
        this.$api.DuctpiecePLM.getProblemInfo({
          pipeId: row.pipeId
        }).then((res) => {
          if(res.success) {
            this.$set(this.formDuctPiece, 'pipeCheckId', res.data.pipeCheckId);
            this.$set(this.formDuctPiece, 'existProblem', res.data.existProblem);
            this.$set(this.formDuctPiece, 'exeProResult', res.data.exeProResult);
            this.$set(this.formDuctPiece, 'exeProNote', res.data.exeProNote);
            this.fileList = res.data.files.map((item, index) => {
              return {
                id: index + 1,
                url: `https://szpipe.thhy-tj.com/${item}`
              }
            })
          }
        })
      },
      // 打开质量追溯
      propCheckHistory(row) {
        this.asyncRetrospect = true;
        this.retrospectInfo = {};
        this.$api.DuctpiecePLM.getCheckHistoryInfo({
          pipeId: row.pipeId
        }).then((res) => {
          if(res.success) {
            this.retrospectInfo = res.data;
          }
        })
      },
      // 提交存在问题
      submitInsertForm: throttle(function() {
        const params = Object.assign({}, this.formDuctPiece);
        params.checkResultStr = this.checkResultStr;
        params.pipeId = this.pipeId;
        this.$api.DuctpiecePLM.insertIssueInfo(params).then((res) => {
          if(res.success) {
            this.asyncDuctPiece = false;
            this.searchDuctpiecePLMList(true);
            this.$message.success('添加成功!');
          } else {
            this.$message.warning(res.statusMsg);
          }
        })
      }, 3000),
      // 提交新增管片信息
      submitInsertPipe: throttle(function() {
        this.$refs.formInsert.validate((valid) => {
          if(valid) {
            const params = Object.assign({}, this.formInsert);
            this.$api.DuctpiecePLM.insertPipeData(params).then((res) => {
              if(res.statusMsg === 'ok') {
                this.asyncInsert = false;
                this.searchDuctpiecePLMList(true);
                this.$message.success('新增成功!');
              } else {
                this.$message.warning(res.statusMsg);
              }
            })
          }
        })
      }, 3000),
      // 提交修改环号信息
      submitUpdatePipe: throttle(function() {
        this.$refs.formInsert.validate((valid) => {
          if(valid) {
            const params = Object.assign({}, this.formInsert);
            this.$api.DuctpiecePLM.updataRingNumData(params).then((res) => {
              if(res.statusMsg === 'ok') {
                this.asyncInsert = false;
                this.searchDuctpiecePLMList(true);
                this.$message.success('修改成功!');
              } else {
                this.$message.warning(res.statusMsg);
              }
            })
          }
        })
      }, 3000),
      //
      showCheckResult(value) {
        return !value ? '' : value == 1 ? '合格' : '存在问题';
      },
      // 根据项目获取尺寸 配筋 块号信息
      changeHeaderProject(data) {
          this.blockNum = '';
          this.reinforcement = '';
          this.groutingHoles = '';
          this.groutingHolesData = [];
          this.blockNumData = [];
          this.reinforcementData = [];
        if(data) {
          this.$api.Basics.getProjectSystemInfoData({
            proId: data
          }).then((res) => {
            this.groutingHolesData = res.data.proGroutings;
            this.blockNumData = res.data.proBloks;
            this.reinforcementData = res.data.proHas;
          })
        }
      },
      // 切换页数
      changePageNum(page) {
        this.pageNum = page;
        this.searchDuctpiecePLMList();
      },
      // 切换每页条数
      changePageSize(size) {
        this.pageSize = size;
        this.searchDuctpiecePLMList();
      },
      // 判断按钮权限信息
      showButton(str) {
        const pinia = buttonPinia();
        return pinia.$state.buttonInfo.includes(str);
      },
        });
    },
    watch: {
      asyncDuctpieceInfo(bol) {
        if(!bol) {
          this.formDuctPiece = {};
          this.pipeId = '';
          this.checkResultStr = '';
          this.fileList = [];
    // 打开新增管片信息
    propInsert() {
      this.asyncTitle = true;
      this.asyncInsert = true;
      this.getAllProjects();
    },
    // 打开修改环号信息
    propUpdate(row) {
      this.asyncTitle = false;
      this.asyncInsert = true;
      this.$set(this.formInsert, "pipeNum", row.pipeNum);
      this.$set(this.formInsert, "ringNum", row.ringNum);
    },
    // 打开修改时间
    propUpdateTime(row) {
      this.asyncTime = true;
      this.$set(this.formTime, "pipeNum", row.pipeNum);
      this.$set(this.formTime, "ringNum", row.ringNum);
      this.$api.DuctpiecePLM.getPipeTimeData({
        pipeNum: row.pipeNum
      }).then(res => {
        if(res.success) {
          this.$set(this.formTime, 'inModTime', res.data.inModTime);
          this.$set(this.formTime, 'outModTime', res.data.outModTime);
          this.$set(this.formTime, 'pouringTime', res.data.pouringTime);
          this.$set(this.formTime, 'placingInTime', res.data.placingInTime);
          this.$set(this.formTime, 'placingOutTime', res.data.placingOutTime);
          this.$set(this.formTime, 'checkTime', res.data.checkTime);
          if(res.data.inWaterFlag) {
            this.$set(this.formTime, 'inWaterTime', res.data.inWaterTime);
          }
          if(res.data.OutWaterFlag) {
            this.$set(this.formTime, 'outWaterTime', res.data.outWaterTime);
          }
          if(res.data.inRepoFlag) {
            this.$set(this.formTime, 'inRepoTime', res.data.inRepoTime);
          }
          // this.$set(this.formInsert, '', res.data.);
        } else {
         this.$message.warning(res.statusMsg);
        }
      },
      asyncInsert(bol) {
        if(!bol) {
          this.steelData = [];
          this.mouldData = [];
          this.formInsert = {};
          this.$refs.formInsert.resetFields();
      })
    },
    // 导出Excel
    exportExcel() {
      this.$api.System.GETEXPORTTOKENDATA({
        ringNum: this.ringNum,
        groupId: this.groupId,
        checkResult: this.checkResult,
        reinforcement: this.reinforcement,
        groutingHoles: this.groutingHoles,
        blockNum: this.blockNum,
        inModStartTime: this.inModTime[0],
        inModEndTime: this.inModTime[1],
        pouringStartTime: this.pouringTime[0],
        pouringEndTime: this.pouringTime[1],
        checkStartTime: this.checkTime[0],
        checkEndTime: this.checkTime[1],
      }).then((res) => {
        if (res.success) {
          downLoadFile(res.data, "/m/pipeInfo/export");
        }
      });
    },
    // 打开存在问题
    propIssue(row) {
      this.pipeId = row.pipeId;
      this.checkResultStr = row.checkResultStr;
      this.issueType = row.type;
      this.asyncDuctPiece = true;
      this.$api.DuctpiecePLM.getProblemInfo({
        pipeId: row.pipeId,
      }).then((res) => {
        if (res.success) {
          this.$set(this.formDuctPiece, "pipeCheckId", res.data.pipeCheckId);
          this.$set(this.formDuctPiece, "existProblem", res.data.existProblem);
          this.$set(this.formDuctPiece, "exeProResult", res.data.exeProResult);
          this.$set(this.formDuctPiece, "exeProNote", res.data.exeProNote);
          this.fileList = res.data.files.map((item, index) => {
            return {
              id: index + 1,
              url: `https://pipe.thhy-tj.com/${item}`,
            };
          });
        }
      });
    },
    // 打开质量追溯
    propCheckHistory(row) {
      this.asyncRetrospect = true;
      this.retrospectInfo = {};
      this.$api.DuctpiecePLM.getCheckHistoryInfo({
        pipeId: row.pipeId,
      }).then((res) => {
        if (res.success) {
          this.retrospectInfo = res.data;
        }
      });
    },
    // 提交存在问题
    submitInsertForm: throttle(function () {
      const params = Object.assign({}, this.formDuctPiece);
      params.checkResultStr = this.checkResultStr;
      params.pipeId = this.pipeId;
      this.$api.DuctpiecePLM.insertIssueInfo(params).then((res) => {
        if (res.success) {
          this.asyncDuctPiece = false;
          this.searchDuctpiecePLMList(true);
          this.$message.success("添加成功!");
        } else {
          this.$message.warning(res.statusMsg);
        }
      });
    }, 3000),
    // 提交新增管片信息
    submitInsertPipe: throttle(function () {
      this.$refs.formInsert.validate((valid) => {
        if (valid) {
          const params = Object.assign({}, this.formInsert);
          this.$api.DuctpiecePLM.insertPipeData(params).then((res) => {
            if (res.statusMsg === "ok") {
              this.asyncInsert = false;
              this.searchDuctpiecePLMList(true);
              this.$message.success("新增成功!");
            } else {
              this.$message.warning(res.statusMsg);
            }
          });
        }
      });
    }, 3000),
    // 提交修改环号信息
    submitUpdatePipe: throttle(function () {
      this.$refs.formInsert.validate((valid) => {
        if (valid) {
          const params = Object.assign({}, this.formInsert);
          this.$api.DuctpiecePLM.updataRingNumData(params).then((res) => {
            if (res.statusMsg === "ok") {
              this.asyncInsert = false;
              this.searchDuctpiecePLMList(true);
              this.$message.success("修改成功!");
            } else {
              this.$message.warning(res.statusMsg);
            }
          });
        }
      });
    }, 3000),
    // 提交修改时间信息
    submitUpdateTime: throttle(function() {
      this.$refs.formTime.validate((valid) => {
        if(valid) {
          const params = Object.assign({}, this.formTime);
          this.$api.DuctpiecePLM.updatePipeTimeData(params).then((res) => {
            if (res.statusMsg === "ok") {
              this.asyncTime = false;
              this.searchDuctpiecePLMList(true);
              this.$message.success("修改成功!");
            } else {
              this.$message.warning(res.statusMsg);
            }
          });
        }
      })
    }, 3000),
    //
    showCheckResult(value) {
      return !value ? "" : value == 1 ? "合格" : "存在问题";
    },
    // 根据项目获取尺寸 配筋 块号信息
    changeHeaderProject(data) {
      this.blockNum = "";
      this.reinforcement = "";
      this.groutingHoles = "";
      this.groutingHolesData = [];
      this.blockNumData = [];
      this.reinforcementData = [];
      if (data) {
        this.$api.Basics.getProjectSystemInfoData({
          proId: data,
        }).then((res) => {
          this.groutingHolesData = res.data.proGroutings;
          this.blockNumData = res.data.proBloks;
          this.reinforcementData = res.data.proHas;
        });
      }
    },
    // 转换毫秒
    transitionMsec(time) {
      let msec = 0;
      const date = Date.parse(new Date(time));
      console.log(date,'==-=-=-')
      return msec;
    },
    // 切换页数
    changePageNum(page) {
      this.pageNum = page;
      this.searchDuctpiecePLMList();
    },
    // 切换每页条数
    changePageSize(size) {
      this.pageSize = size;
      this.searchDuctpiecePLMList();
    },
    // 判断按钮权限信息
    showButton(str) {
      const pinia = buttonPinia();
      return pinia.$state.buttonInfo.includes(str);
    },
  },
  watch: {
    asyncDuctpieceInfo(bol) {
      if (!bol) {
        this.formDuctPiece = {};
        this.pipeId = "";
        this.checkResultStr = "";
        this.fileList = [];
      }
    },
    asyncInsert(bol) {
      if (!bol) {
        this.steelData = [];
        this.formInsert = {};
        this.$refs.formInsert.resetFields();
      }
    },
    asyncTime(bol) {
      if(!bol) {
        this.formTime = {};
        this.$refs.formTime.resetFields();
      }
    }
  }
  },
};
</script>
<style lang="scss" scoped>
@import '../../style/layout-main.scss';
@import "../../style/layout-main.scss";
.issue_status {
  color: #F42829;
  color: #f42829;
}
.retrospect_content {
@@ -594,7 +970,7 @@
    padding: 0 15px 15px;
    font-size: 16px;
    font-weight: 600;
    color: #FFF;
    color: #fff;
    border-bottom: 1px solid #0d5274;
    &::before {
@@ -605,7 +981,7 @@
      transform: translateY(-85%);
      width: 3px;
      height: 50%;
      background: #18F6F8;
      background: #18f6f8;
    }
  }
@@ -614,22 +990,22 @@
    margin: 10px 10px 10px 0;
    .table_item {
      border: 1px solid #1CB7E0;
      border: 1px solid #1cb7e0;
      border-right: none;
      &:last-child {
        border-right: 1px solid #1CB7E0;
        border-right: 1px solid #1cb7e0;
      }
      .table_item_chunk {
        padding: 10px;
        color: #18F6F8;
        color: #18f6f8;
        text-align: center;
      }
      .table_th {
        border-bottom: 1px solid #1CB7E0;
        background: #082F57;
        border-bottom: 1px solid #1cb7e0;
        background: #082f57;
      }
    }
  }
@@ -649,4 +1025,4 @@
::v-deep .el-date-editor .el-range-separator {
  color: #fff !important;
}
</style>
</style>