xiangpei
2024-09-01 a8e77f3b05d6d96c9bc64f550651b153d8238e88
src/views/system/work-order/index.vue
@@ -11,14 +11,13 @@
        />
      </el-form-item>
      <el-form-item label="故障类型" prop="errorTypeList">
        <el-select v-model="queryParams.errorTypeList" multiple placeholder="故障类型" clearable @clear="handleQuery">
          <el-option v-for="dict in dict.type.error_type"
                     :value="dict.value"
                     :label="dict.label"/>
        <el-select v-model="queryParams.errorTypeList" multiple @change="handleQuery" placeholder="故障类型" clearable @clear="handleQuery">
          <el-option v-for="dict in dict.type.error_type" :value="dict.value" :key="dict.value" :label="dict.label" />
        </el-select>
      </el-form-item>
      <el-form-item label="工单状态" prop="status">
        <el-select v-model="queryParams.status" placeholder="工单状态" @change="handleQuery">
          <el-option label="全部" value=""></el-option>
          <el-option label="待处理" value="DISTRIBUTED"></el-option>
          <el-option label="待审核" value="YW_HANDLE"></el-option>
          <el-option label="已完成" value="AUDITING_SUCCESS"></el-option>
@@ -44,7 +43,7 @@
      </el-col>
    </el-row>
    <el-row v-if="workOrderList && workOrderList.length > 0" :gutter="20" v-loading="loading">
    <el-row :gutter="20" v-loading="loading">
      <el-col :xl="6" :lg="8" :md="12" :sm="24" v-for="item in workOrderList" :key="item.id">
        <div class="my-col">
          <div style="padding-left: 10px; padding-top: 8px">
@@ -65,14 +64,25 @@
              <div class="card">
                <div class="card-left">
                  <el-image
                    :preview-src-list="['https://img2.baidu.com/it/u=68398439,1553004927&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=357']"
                    fit="cover" src="https://img2.baidu.com/it/u=68398439,1553004927&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=357"
                    v-if="item.imgList && item.imgList.length > 0"
                    :preview-src-list="item.imgList"
                    fit="cover" :src="item.imgList[0]"
                    class="image"
                  />
                    style="display: flex;justify-content: center;align-items: center;"
                  >
                    <div slot="error" class="image-slot">
                      <i class="el-icon-picture-outline">加载失败</i>
                    </div>
                  </el-image>
                  <el-image class="image" style="display: flex;justify-content: center;align-items: center;" v-else>
                    <div slot="error" class="image-slot">
                      <i class="el-icon-picture-outline" style="color: gray;font-size: 14px">未取到图片</i>
                    </div>
                  </el-image>
                </div>
                <div class="work-order">
                  <el-row class="work-order-item">
                    <el-col :span="24" class="time">工单编号:{{ item.workOrderNo }}</el-col>
                    <el-col :span="24" class="time">工单号:{{ item.workOrderNo }}</el-col>
                  </el-row>
                  <el-row class="work-order-item">
                    <el-col :span="24" class="time">故障时间:{{ item.createTime }}</el-col>
@@ -94,6 +104,8 @@
                      class="my-button"
                      size="mini"
                      type="text"
                      v-hasPermi="['work:order:condition:add']"
                      v-show="item.status !== 'AUDITING_SUCCESS'"
                      @click="handleYwCondition(item)"
                    >运维情况
                    </el-button>
@@ -110,6 +122,7 @@
                      type="text"
                      @click="handleReport(item)"
                      v-hasPermi="['system:report:add']"
                      v-show="item.status !== 'AUDITING_SUCCESS'"
                    >事后报备
                    </el-button>
                  </el-row>
@@ -130,7 +143,7 @@
      </el-col>
    </el-row>
    <el-empty v-else description="暂无数据"></el-empty>
    <el-empty v-if="empty" description="暂无数据"></el-empty>
    <pagination
      v-show="total>0"
@@ -159,7 +172,7 @@
        <el-form-item label="报备内容" prop="reportContent">
          <editor v-model="reportForm.reportContent" :min-height="192"/>
        </el-form-item>
        <el-form-item label="上报材料" prop="reportMaterials">
        <el-form-item label="报备材料" prop="reportMaterials">
          <file-upload v-model="reportForm.reportMaterials"/>
        </el-form-item>
      </el-form>
@@ -240,9 +253,7 @@
      >
        <el-form-item label="故障类型" prop="errorType">
          <el-select v-model="batchAuditingWorkOrder.errorTypes" multiple placeholder="故障类型">
            <el-option v-for="(item, index) in errorTypeOptions" :label="item.dictLabel" :value="item.dictValue"
                       :key="index"
            ></el-option>
            <el-option v-for="dict in dict.type.error_type" :value="dict.value" :key="dict.value" :label="dict.label" />
          </el-select>
        </el-form-item>
        <el-form-item label="审核说明" prop="auditingRemark">
@@ -263,22 +274,25 @@
          <el-step title="产生工单">
            <template slot="description">
              <div>
                <div class="flow-item-x">
                  工单来源:
                  <el-tag type="danger" size="small">{{ flowForm.source }}</el-tag>
                <div class="row flow-item-x">
                  <div class="flex1">故障点位:</div>
                  <div class="flex2"><el-tag type="danger" size="small">{{ flowForm.source }}</el-tag></div>
                </div>
                <div class="flow-item-x">
                  故障类型:{{ flowForm.errorType }}
                <div class="row flow-item-x">
                  <div class="flex1">故障类型:</div>
                  <div class="flex2">{{ flowForm.errorType }}</div>
                </div>
                <div class="flow-item-x">
                  运维单位:{{ flowForm.unitName }}
                <div class="row flow-item-x">
                  <div class="flex1">运维单位:</div>
                  <div class="flex2">{{ flowForm.unitName }}</div>
                </div>
                <div class="flow-item-x">
                  创建时间:{{ flowForm.createTime }}
                <div class="row flow-item-x">
                  <div class="flex1">创建时间:</div>
                  <div class="flex2">{{ flowForm.createTime }}</div>
                </div>
                <div class="flow-item-x" v-if="flowForm.processingPeriod">
                  处理期限:
                  <el-tag type="danger" size="small">{{ flowForm.processingPeriod }}</el-tag>
                <div class="row flow-item-x" v-if="flowForm.processingPeriod">
                  <div class="flex1">处理期限:</div>
                  <div class="flex2"><el-tag type="danger" size="small">{{ flowForm.processingPeriod }}</el-tag></div>
                </div>
              </div>
            </template>
@@ -286,26 +300,51 @@
          <el-step title="运维处理">
            <template slot="description">
              <div style="max-height: 450px;overflow-y: scroll">
                <div class="y-item" v-for="(item, index) in ywHandleList" :key="index">
                  <div class="y-item-1">
                    <div class="flow-item-x">
                      现场情况:
                      <!-- <el-tooltip class="item" effect="dark" :content="item.ywCondition" placement="top"> -->
                      <span v-html="item.ywCondition"></span>
                      <!-- </el-tooltip> -->
                    </div>
                    <!-- <div class="flow-item-x">
                      <el-tag size="small" v-for="file in item.ywProofMaterials != null ? item.ywProofMaterials.split(',') : item.ywProofMaterials" :key="file" @click="handleDownload(file)">{{ file.substring(file.lastIndexOf("/") + 1) }}</el-tag>
                    </div> -->
                <div v-for="(item, index) in ywHandleList" :key="index">
                  <div v-if="item.sysMsg === true" class="row flow-item-x">
                    <div class="cflex1">系统消息:</div>
                    <div class="cflex2">{{item.ywCondition}}</div>
                    <div class="cflex3">{{item.createTime}}</div>
                  </div>
                  <div class="y-item-2">
                    <div>
                      {{ parseTime(item.createTime) }}
                  <div v-else style="width: 100%">
                    <div style="display: flex; flex-direction: row;width: 100%;position: relative">
                      <div class="cflex1">运维情况:</div>
                      <div class="cflex2"><el-link style="font-size: 14px" type="danger" @click="openDrawer(item)">点击查看</el-link></div>
                      <div class="cflex3">{{item.createTime}}</div>
                    </div>
                    <div>
                      第{{ index + 1 }}次
                    </div>
                    <el-drawer
                      title="运维情况"
                      :visible.sync="drawer"
                      direction="rtl"
                      :modal="false"
                      >
                      <div style="padding: 20px;font-size: 14px">
                        <div class="row flow-item-x">
                          <div class="flex1"><p>上报内容:</p></div>
                          <div class="flex2">
                            <div v-html="ywData.content"></div>
                          </div>
                        </div>
                        <div class="row flow-item-x">
                          <div class="flex1"><p>佐证材料:</p></div>
                          <div class="flex2">
                            <p>
                              <el-link type="primary"
                                       v-for="item in ywData.fileList != null ? ywData.fileList.split(',') : ywData.fileList"
                                       :underline="false" :key="item.id" @click="handleDownload(item)"
                              >{{ item.substring(item.lastIndexOf('/') + 1) }}
                              </el-link>
                            </p>
                          </div>
                        </div>
                      </div>
                    </el-drawer>
                      <!-- <div class="flow-item-x">
                        <el-tag size="small" v-for="file in item.ywProofMaterials != null ? item.ywProofMaterials.split(',') : item.ywProofMaterials" :key="file" @click="handleDownload(file)">{{ file.substring(file.lastIndexOf("/") + 1) }}</el-tag>
                      </div> -->
                  </div>
                </div>
              </div>
            </template>
@@ -313,25 +352,26 @@
          <el-step title="审核结果">
            <template slot="description">
              <div style="max-height: 450px;overflow-y: scroll">
                <div class="y-item" v-for="(item, index) in ywAuditingList" :key="index">
                  <div class="y-item-1">
                    <div class="flow-item-x">
                <div v-for="(item, index) in ywAuditingList" :key="index">
                  <div class="row flow-item-x">
                    <div class="cflex1">
                      审核结果:
                    </div>
                    <div class="cflex2">
                      <el-tag :type="item.result == '审核通过' ? 'success' : 'danger'" size="small">{{
                          item.result
                        }}
                      </el-tag>
                    </div>
                    <div class="flow-item-x">
                      审核说明:<span v-html="item.remark"></span>
                    <div class="cflex3">
                      {{ item.createTime }}
                    </div>
                  </div>
                  <div class="y-item-2">
                    <div>
                      {{ parseTime(item.createTime) }}
                    </div>
                    <div>
                      第{{ index + 1 }}次
                  <div class="row flow-item-x">
                    <div class="flex1">审核说明:</div>
                    <div class="flex2">
                      <span v-if="item.remark" v-html="item.remark"></span>
                      <span v-else>无</span>
                    </div>
                  </div>
                </div>
@@ -345,6 +385,26 @@
  </div>
</template>
<style scoped>
.flex1 {
  flex: 2;
}
.flex2 {
  flex: 9;
}
.cflex1 {
  flex: 2;
}
.cflex2 {
  flex: 5;
  flex-wrap: wrap;
}
.cflex3 {
  flex: 4;
}
.row {
  display: flex;
  flex-direction: row;
}
.flow-item-x {
  margin: 5px 0;
}
@@ -355,7 +415,8 @@
  background-color: #d9d9d9;
  display: flex;
  flex-direction: row;
  align-items: center
  align-items: center;
  width: 100%;
}
.y-item-2 {
@@ -377,11 +438,9 @@
  batchAuditing,
  ywCondition,
  getYwCondition,
  getYwConditionList,
  getYwAuditingList
  process
} from '@/api/platform/work-order'
import { addReport } from '@/api/platform/report'
import { getDicts } from '@/api/system/dict/data'
export default {
  name: 'Work-order',
@@ -389,8 +448,9 @@
  components: {},
  data() {
    return {
      drawer: false,
      empty: false,
      openShowCurrent: null,
      errorTypeOptions: [],
      ywConditions: [],
      batchAuditingVisible: false,
      batchAuditingWorkOrder: {
@@ -405,7 +465,7 @@
          { required: true, message: '报备内容不能为空', trigger: 'blur' }
        ],
        reportMaterials: [
          { required: true, message: '上报材料不能为空', trigger: 'blur' }
          { required: true, message: '报备材料不能为空', trigger: 'blur' }
        ]
      },
      reportOpen: false,
@@ -493,6 +553,11 @@
        errorTypes: [
          { required: true, message: '请选择故障类型', trigger: 'change' }
        ]
      },
      // 运维情况
      ywData: {
        content: '',
        fileList: 'process.env.VUE_APP_BASE_API'
      }
    }
  },
@@ -500,6 +565,15 @@
    this.getList()
  },
  methods: {
    openDrawer(item) {
      this.ywData = {
        content: '',
        fileList: ''
      }
      this.ywData.content = item.ywCondition
      this.ywData.fileList = item.ywProofMaterials
      this.drawer = true
    },
    // 批量审核
    batchAuditing(result) {
      this.batchAuditingWorkOrder.auditingResult = result
@@ -539,7 +613,7 @@
    // 审核按钮
    handleAuditing(row) {
      this.auditingForm = row
      getYwCondition(row.id).then(response => {
      getYwCondition(row.workOrderNo).then(response => {
        this.ywConditions = response.data
        this.auditingOpen = true
      })
@@ -564,16 +638,12 @@
    // 过程图查看
    handleFlow(row) {
      this.flowForm = row
      getYwAuditingList(row.id).then(response => {
      process(row.workOrderNo).then(response => {
        if (response.data) {
          this.ywAuditingList = response.data
          this.ywAuditingList = response.data.auditingList
          this.ywHandleList = response.data.ywList
          this.flowOpen = true
        }
      })
      getYwCondition(row.id).then(response => {
        if (response.data) {
          this.ywHandleList = response.data
        }
        this.flowOpen = true
      })
    },
    // 提交审核
@@ -653,22 +723,26 @@
    },
    /** 查询运维工单列表 */
    getList() {
      this.empty = false;
      this.loading = true
      this.queryParams.params = {}
      this.queryParams['start'] = this.daterangeYwHandleTime ? this.daterangeYwHandleTime[0] : null
      this.queryParams['end'] = this.daterangeYwHandleTime ? this.daterangeYwHandleTime[1] : null
      if (this.queryParams['status'] == '') {
        this.queryParams['status'] = 'DISTRIBUTED'
      }
      listWorkOrder(this.queryParams).then(response => {
        // response.data.forEach(item => {
        //   if (item.errorType) {
        //     item.errorTypeList = item.errorTypeList.split(",")
        //   }
        // })
        response.data.forEach(item => {
          if (item.imgList) {
            item.imgList = item.imgList.map(img => {
              return this.$img + img
            })
          }
        })
        this.workOrderList = response.data
        this.total = response.total
        this.loading = false
        if (this.total === 0) {
          this.empty = true
        }
      })
    },
    // 取消按钮
@@ -841,4 +915,7 @@
.my-col {
  margin-bottom: 20px; box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px; position: relative;
}
::v-deep el-step__description.is-finish {
  color: gray;
}
</style>