<template>
  <view class="container">
    <view class="card">
      <u-cell-group>
        <view v-for="(item, index) in list" :key="index">
          <u-cell :title="item.JOB_TYPE_DESCRIBE">
            <template #label>
              <view class="mt-10">
                <view>部门：{{ item.JOB_DEPARTMENT_NAME }}</view>
                <view>人员：{{ item.JOB_NAME }}</view>
                <view>
                  审批结果：{{ item.PASS_FLAG === 0 ? "不通过" : "通过" }}
                </view>
                <view v-if="item.SIGN_PICTURE">
                  <u-image
                      width="400rpx"
                      height="200rpx"
                      :src="$filePath + item.SIGN_PICTURE"
                      mode="widthFix"
                  />
                  <view>审批意见：{{ item.APPROVAL_OPINIONS }}</view>
                  <view>时间：{{ item.CREATE_TIME }}</view>
                </view>
              </view>
            </template>
          </u-cell>
        </view>
      </u-cell-group>
    </view>
  </view>
</template>

<script>
import {getHistoricalApprovalRecords} from "@/api";
export default {
  data() {
    return {
      list: [],
      EW_RU_TASK_ID: '',
      EW_RU_JOB_ID: ''
    }
  },
  onLoad(query) {
    this.EW_RU_TASK_ID = query.taskId;
    this.EW_RU_JOB_ID = query.EW_RU_JOB_ID;
    this.fnGetData();
  },
  methods: {
    async fnGetData() {
      let resData = await getHistoricalApprovalRecords({
        EW_RU_TASK_ID: this.EW_RU_TASK_ID,
        EW_RU_JOB_ID: this.EW_RU_JOB_ID,
      });
      this.list = resData.list;
    },
  }
}
</script>

<style scoped lang="scss"></style>
