1、我的待办页面 设备点检 分类审批弹窗功能逻辑开发并复用至我的已办、流程管理和点检工单页面
2、我的待办页面 设备周保流程 分类审批弹窗功能逻辑调整并复用至周保工单页面
3、周保工单页面以及详情列表功能bug修改
4、点检工单页面及新增弹窗功能bug修改
5、工作流我的待办页面 设备点检 分类详情弹窗样式调整为设备周保流程一致
6、工作流我的待办页面 设备周保流程 分类详情弹窗保养明细列表功能逻辑调整
已修改9个文件
已删除11个文件
6465 ■■■■ 文件已修改
src/views/eam/maintenance/EamInspectionOrderList.vue 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/maintenance/EamWeekMaintenanceOrderList.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/maintenance/modules/EamInspectionOrderDetailForm.vue 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/maintenance/modules/EamInspectionOrderForm.vue 164 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/maintenance/modules/EamInspectionOrderModal.vue 513 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/maintenance/modules/EamInspectionOrderModalXq.vue 360 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/maintenance/modules/EamWeekMaintenanceOrderModal.vue 554 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/FlowCompleted.vue 299 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/FlowLedger.vue 351 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/FlowTodo.vue 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue 432 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/InspectionOrder/InspectionOrderHandleBzz.vue 468 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/InspectionOrder/InspectionOrderXq.vue 443 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/assignFileStream/AssignFileStreamHandle.vue 432 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/assignFileStream/AssignFileStreamXq.vue 389 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/dispatchFile/DispatchFileBachHandleForm.vue 216 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/dispatchFile/DispatchFileBachHandleStyle#Drawer.vue 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/dispatchFile/DispatchFileHandle.vue 415 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/dispatchFile/DispatchFileXq.vue 364 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/weekMaintenance/WeekMaintenanceApprovalModal.vue 775 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/maintenance/EamInspectionOrderList.vue
@@ -134,7 +134,8 @@
    </div>
    <eam-inspection-order-modal ref="modalForm" @ok="modalFormOk"></eam-inspection-order-modal>
    <EamInspectionOrderModalXq ref="modalFormXq" @ok="modalFormOk"></EamInspectionOrderModalXq>
    <inspection-order-handle ref="modalFormXq" :selectShenpiData="selectInspectionOrderXqData"/>
  </a-card>
</template>
@@ -144,17 +145,17 @@
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import EamInspectionOrderModal from './modules/EamInspectionOrderModal'
  import EamInspectionOrderModalXq from './modules/EamInspectionOrderModalXq.vue'
  import { deleteAction, getAction } from '@api/manage'
  import InspectionOrderHandle from '../../flowable/workflow/InspectionOrder/InspectionOrderHandle'
  import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
  export default {
    name: 'EamInspectionOrderList',
    mixins: [JeecgListMixin, mixinDevice],
    components: {
      LxSearchEquipmentSelect,
      InspectionOrderHandle,
      EamInspectionOrderModal,
      EamInspectionOrderModalXq
      LxSearchEquipmentSelect,
    },
    props: {
      isDisplayOperation: {
@@ -247,7 +248,7 @@
        ],
        url: {
          list: '/eam/eamInspectionOrder/list',
          cancelInspectionOrder: "/eam/eamInspectionOrder/cancelInspectionOrder",
          cancelInspectionOrder: '/eam/eamInspectionOrder/cancelInspectionOrder',
          deleteBatch: '/eam/eamInspectionOrder/deleteBatch',
          exportXlsUrl: '/eam/eamInspectionOrder/exportXls',
          importExcelUrl: 'eam/eamInspectionOrder/importExcel',
@@ -255,7 +256,8 @@
          cancelOrReceive: 'eam/eamInspectionOrder/cancelOrReceive'
        },
        dictOptions: {},
        superFieldList: []
        superFieldList: [],
        selectInspectionOrderXqData: {}
      }
    },
    created() {
@@ -283,9 +285,12 @@
      },
      //详情
      handleDetail: function(record) {
        this.$refs.modalFormXq.edit(record)
        this.selectInspectionOrderXqData = Object.assign({}, record)
        this.$refs.modalFormXq.visible = true
        this.$refs.modalFormXq.title = '详情'
        this.$refs.modalFormXq.disableSubmit = true
        this.$refs.modalFormXq.getAllApproveData(record)
        this.$refs.modalFormXq.getBasicInformation({ ...record, dataId: record.id })
      },
      handleInspection(id) {
        if (!this.url.receiveInspectionOrder) {
@@ -309,27 +314,27 @@
          }
        })
      },
      handleOrReceive(id){
      handleOrReceive(id) {
        if (!this.url.cancelInspectionOrder) {
          this.$message.error("请设置url.cancelInspectionOrder!")
          this.$message.error('请设置url.cancelInspectionOrder!')
          return
        }
        var that = this;
        var that = this
        getAction(that.url.cancelInspectionOrder, { id: id }).then((res) => {
          if (res.success) {
            that.$notification.success({
              message: '消息',
              description: res.message
            });
            that.loadData();
            })
            that.loadData()
          } else {
            // that.$message.warning(res.message);
            that.$notification.warning({
              message: '消息',
              description: res.message
            });
            })
          }
        });
        })
      },
      batchZf(type) {
        if (this.selectedRowKeys.length <= 0) {
src/views/eam/maintenance/EamWeekMaintenanceOrderList.vue
@@ -74,6 +74,7 @@
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        :scroll="{x:'max-content'}"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">
@@ -106,7 +107,7 @@
    <!-- è¡¨å•区域 -->
    <eamWeekMaintenanceOrder-modal ref="modalForm" @ok="modalFormOk"></eamWeekMaintenanceOrder-modal>
    <week-maintenance-approval-modal ref="weekMaintenanceApprovalModal"></week-maintenance-approval-modal>
    <week-maintenance-approval-modal ref="weekMaintenanceApprovalModal" :selectShenpiData="selectWeekMaintenanceData"></week-maintenance-approval-modal>
  </a-card>
</template>
@@ -136,6 +137,7 @@
    return {
      description: '周保工单管理页面',
      disableMixinCreated: true,
      selectWeekMaintenanceData:{},
      // è¡¨å¤´
      columns: [
        {
@@ -414,6 +416,7 @@
    },
    handleDetail(record) {
      this.selectWeekMaintenanceData = Object.assign({}, record)
      this.$refs.weekMaintenanceApprovalModal.recordDetail(record)
      this.$refs.weekMaintenanceApprovalModal.title = '详情';
      this.$refs.weekMaintenanceApprovalModal.disableSubmit = true
src/views/eam/maintenance/modules/EamInspectionOrderDetailForm.vue
ÎļþÒÑɾ³ý
src/views/eam/maintenance/modules/EamInspectionOrderForm.vue
ÎļþÒÑɾ³ý
src/views/eam/maintenance/modules/EamInspectionOrderModal.vue
@@ -6,80 +6,69 @@
    :confirmLoading="confirmLoading"
    switchFullscreen
    centered
    :mask-closable="false"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
    <a-spin :spinning="spinning">
      <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="工单号">
              <a-input placeholder="工单号自动生成" v-model="model.orderNum" disabled />
            <a-form-model-item prop="standardCode" label="工单号">
              <a-input placeholder="工单号自动生成" v-model="model.orderNum" readOnly/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="设备编号">
            <a-form-model-item prop="equipmentId" label="设备编号">
              <MaintenanceEquipmentSelect placeholder="请输入设备编号或名称搜索" v-model="model.equipmentId"
                                          :maintenanceCategory="maintenanceCategory" :disabled="editable"
                                          @autocompleteForm="autocompleteForm"></MaintenanceEquipmentSelect>
                                          :maintenanceCategory="maintenanceCategory" :disabled="disabled"
                                          @autocompleteForm="autocompleteForm"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardName" label="标准名称">
              <a-input placeholder="请输入标准名称" disabled v-model="model.standardName" />
            <a-form-model-item prop="standardName" label="标准名称">
              <a-input placeholder="选择设备后自动带出" readOnly v-model="model.standardName"/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="标准编码">
              <a-input placeholder="请输入标准编码" disabled v-model="model.standardCode" />
            <a-form-model-item prop="standardCode" label="标准编码">
              <a-input placeholder="选择设备后自动带出" readOnly v-model="model.standardCode"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancePeriod" label="保养周期">
              <a-input-number v-model="model.maintenancePeriod" :min="1" :precision="0" disabled style="width: 100%" />
            <a-form-model-item label="保养周期">
              <a-input placeholder="选择设备后自动带出" v-model="model.maintenancePeriod" readOnly/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator" label="点检人">
              <j-dict-select-tag v-model="model.operator" placeholder="请选择用户" dictCode="sys_user,realname,username,username!='admin' order by create_time"/>
            <a-form-model-item prop="operator" label="点检人">
              <j-search-select-tag v-model="model.operator" placeholder="请选择点检人" :disabled="!model.equipmentId"
                                   :dictOptions="maintenanceOperatorOptions"/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-model-item label="点检日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionDate">
              <j-date placeholder="请选择点检日期" v-model="model.inspectionDate" @change="expirationTimeFrom(model.inspectionDate)" style="width: 100%" />
            <a-form-model-item label="点检日期" prop="inspectionDate">
              <j-date :placeholder="!model.maintenancePeriod?'请填写保养周期':'请选择点检日期'" v-model="model.inspectionDate"
                      :disabled="!model.maintenancePeriod"
                      @change="expirationTimeFrom(model.inspectionDate)" style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="点检过期时间" :labelCol="{span:6}" :wrapperCol="{span:15}" prop="expirationTime">
              <j-date placeholder="请选择点检过期时间" v-model="model.expirationTime" disabled style="width: 100%" />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-model-item
              label="照片文件"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="imageFiles">
              <lx-upload :returnUrl="false"
                         :multiple="false"
                         v-model="model.imageFiles"
                         biz="EamMaintenanceStandard">
              </lx-upload>
            <a-form-model-item label="点检过期时间">
              <j-date placeholder="选择点检日期后自动带出" v-model="model.expirationTime" disabled style="width: 100%"/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-model-item label="备注" :labelCol="{span:1}" :wrapperCol="{span:22}" prop="remark">
              <a-textarea v-model="model.remark" rows="3" placeholder="请输入备注" />
            <a-form-model-item label="备注" :labelCol="{span:2}" :wrapperCol="{span:21}" prop="remark">
              <a-textarea v-model="model.remark" rows="3" placeholder="请输入备注"/>
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -96,7 +85,7 @@
            :loading="detail.loading"
            :dataSource="detail.dataSource"
            :columns="detail.columns"
            style="margin-top: 8px;" />
            style="margin-top: 8px;"/>
        </a-row>
      </a-form-model>
    </a-spin>
@@ -104,215 +93,271 @@
</template>
<script>
import { getAction, httpAction } from '@/api/manage'
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
import { JVXETypes } from '@/components/jeecg/JVxeTable'
import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect'
import moment from 'dayjs'
  import { getAction, httpAction } from '@/api/manage'
  import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
  import { JVXETypes } from '@/components/jeecg/JVxeTable'
  import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect'
  import moment from 'dayjs'
export default {
  name: 'EamMaintenanceStandardModal',
  mixins: [JVxeTableModelMixin],
  components: {
    MaintenanceEquipmentSelect
  },
  data() {
    return {
      title: '操作',
      visible: false,
      model: {},
      editable: false,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      },
      confirmLoading: false,
      validatorRules: {
        standardName: [
          { required: true, message: '请输入标准名称!' }
        ],
        maintenanceCategory: [
          { required: true, message: '请选择保养分类!' }
        ],
        initialDate: [
          { required: true, message: '请选择初始日期!' }
        ],
        maintenancePeriod: [
          { required: true, message: '请输入保养周期,单位:天!' }
        ],
        equipmentId: [
          { required: true, message: '请选择设备!' }
        ],
      },
      url: {
        add: '/eam/eamInspectionOrder/add',
        edit: '/eam/eamInspectionOrder/edit',
        detail: '/eam/eamMaintenanceStandardDetail/queryList',
        detailOrder: '/eam/eamInspectionOrderDetail/queryList'
      },
      maintenanceCategory: 'POINT_INSPECTION',
      standardId:"",
      standardType:false,
      detail: {
        loading: false,
        dataSource: [],
        columns: [
          {
            title: '序号',
            key: 'itemCode',
            type: JVXETypes.inputNumber,
            width: '10%',
            align:"center",
            validateRules: [
              {required : true, unique: true, message: '序号不能重复'}
            ]
          },
          {
            title: '保养项',
            key: 'itemName',
            type: JVXETypes.textarea,
            width: '20%',
            align:"center",
            validateRules: [
              {required : true, message: '保养项不能为空!'}
            ]
          },
          {
            title: '保养要求',
            key: 'itemDemand',
            type: JVXETypes.textarea,
            width: '30%',
            align:"center",
            validateRules: [
              {required : true, message: "保养要求不能为空!"}
            ]
          },
        ]
      }
    }
  },
  created() {
  },
  methods: {
    add() {
      this.model = {}
      this.detail.dataSource = [];
      this.visible = true
      this.editable = false
      this.standardType=false;
  export default {
    name: 'EamMaintenanceStandardModal',
    mixins: [JVxeTableModelMixin],
    components: {
      MaintenanceEquipmentSelect
    },
    edit(record) {
      console.log(record)
      this.model = Object.assign({}, record)
      this.standardId=record.standardId
      this.standardType=true;
      this.visible = true
      this.editable = true
      this.detail.dataSource = []
      if (record && record.referenceFile) {
        let obj = JSON.parse(record.referenceFile)
        this.model.fileList = [obj]
      } else {
        this.model.fieldList = []
      }
      this.loadDetailOrder(record.id)
    },
    close() {
      this.$emit('close')
      this.visible = false
      this.$refs.form.clearValidate()
    },
    async handleOk() {
      const that = this
      let errMap = await that.$refs.editableDetailTable.validateTable()
      if (errMap) {
        this.$message.warning('数据校验失败!')
        return
      }
      // è§¦å‘表单验证
      this.$refs.form.validate(valid => {
        if (valid) {
          let tableData = that.$refs.editableDetailTable.getTableData()
          let removeData = that.$refs.editableDetailTable.getDeleteData()
          that.model.tableDetailList = [...tableData]
          that.model.removeDetailList = [...removeData]
          that.confirmLoading = true
          let httpurl = ''
          let method = ''
          if (!this.model.id) {
            httpurl += this.url.add
            method = 'post'
          } else {
            httpurl += this.url.edit
            method = 'put'
          }
          this.model.standardId=this.standardId
          httpAction(httpurl, this.model, method).then((res) => {
            if (res.success) {
              that.$message.success(res.message)
              that.$emit('ok')
              that.close()
            } else {
              that.$message.warning(res.message)
    data() {
      return {
        title: '操作',
        visible: false,
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 6 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 15 }
        },
        confirmLoading: false,
        spinning: false,
        disabled: false,
        validatorRules: {
          // standardName: [
          //   { required: true, message: '请输入标准名称!' }
          // ],
          inspectionDate: [
            { required: true, message: '请选择点检日期!' }
          ],
          // maintenancePeriod: [
          //   { required: true, message: '请输入保养周期,单位:天!' }
          // ],
          equipmentId: [
            { required: true, message: '请选择设备!' }
          ]
        },
        url: {
          add: '/eam/eamInspectionOrder/add',
          edit: '/eam/eamInspectionOrder/edit',
          detail: '/eam/eamMaintenanceStandardDetail/queryList',
          detailOrder: '/eam/eamInspectionOrderDetail/queryList',
          userSelect: '/eam/user_select/list'
        },
        maintenanceCategory: 'POINT_INSPECTION',
        maintenanceOperatorOptions: [],
        standardId: '',
        standardType: false,
        detail: {
          loading: false,
          dataSource: [],
          columns: [
            {
              title: '序号',
              key: 'itemCode',
              type: JVXETypes.inputNumber,
              width: '10%',
              align: 'center',
              validateRules: [
                { required: true, unique: true, message: '序号不能重复' }
              ]
            },
            {
              title: '保养项',
              key: 'itemName',
              type: JVXETypes.textarea,
              width: '20%',
              align: 'center',
              validateRules: [
                { required: true, message: '保养项不能为空!' }
              ]
            },
            {
              title: '保养要求',
              key: 'itemDemand',
              type: JVXETypes.textarea,
              width: '30%',
              align: 'center',
              validateRules: [
                { required: true, message: '保养要求不能为空!' }
              ]
            }
          }).finally(() => {
            that.confirmLoading = false
          })
        } else {
          return false
          ]
        }
      })
    },
    handleCancel() {
      this.close()
    },
    autocompleteForm(selectObj) {
      this.model.standardName = selectObj.standardName
      this.model.maintenancePeriod=selectObj.maintenancePeriod
      this.model.standardCode=selectObj.standardCode
      if (!this.standardType) {
        this.standardId=selectObj.id
        this.loadDetail(selectObj.id)
      }
    },
    expirationTimeFrom(date) {
      //过期时间是初始时间+保养周期
      if (date && this.model.maintenancePeriod) {
        // è½¬æ¢ä¸ºæ—¶é—´æˆ³å­—符串(或指定格式)
        this.model.expirationTime = moment(date)
          .add(this.model.maintenancePeriod, 'days')
          .format('YYYY-MM-DD')
      } else {
        this.model.expirationTime = null; // æ¸…空无效值
      }
    created() {
    },
    //加载详情数据
    loadDetail(standardId) {
      if (standardId) {
        getAction(this.url.detail, { standardId: standardId }).then(res => {
          if (res.success) {
            this.detail.dataSource = [...res.result]
            this.standardType=false;
    methods: {
      add() {
        this.model = {}
        this.detail.dataSource = []
        this.visible = true
        this.disabled = false
        this.standardType = false
      },
      edit(record) {
        this.model = Object.assign({}, record)
        this.standardId = record.standardId
        this.disabled = true
        this.standardType = true
        this.visible = true
        this.detail.dataSource = []
        if (record && record.referenceFile) {
          let obj = JSON.parse(record.referenceFile)
          this.model.fileList = [obj]
        } else {
          this.model.fieldList = []
        }
        this.loadDetailOrder(record.id)
      },
      async handleOk() {
        const that = this
        let errMap = await that.$refs.editableDetailTable.validateTable()
        if (errMap) {
          this.$message.warning('数据校验失败!')
          return
        }
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            let tableData = that.$refs.editableDetailTable.getTableData()
            let removeData = that.$refs.editableDetailTable.getDeleteData()
            that.model.tableDetailList = [...tableData]
            that.model.removeDetailList = [...removeData]
            that.confirmLoading = that.spinning = true
            let httpurl = ''
            let method = ''
            if (!this.model.id) {
              httpurl += this.url.add
              method = 'post'
            } else {
              httpurl += this.url.edit
              method = 'put'
            }
            this.model.standardId = this.standardId
            httpAction(httpurl, this.model, method).then((res) => {
              if (res.success) {
                that.$message.success(res.message)
                that.$emit('ok')
                that.close()
              } else {
                that.$message.warning(res.message)
              }
            }).finally(() => {
              that.confirmLoading = that.spinning = false
            })
          } else {
            return false
          }
        })
      }
    },
    loadDetailOrder(orderId){
      if (orderId) {
        getAction(this.url.detailOrder, { orderId: orderId }).then(res => {
          if (res.success) {
            this.detail.dataSource = [...res.result]
          }
        })
      },
      autocompleteForm(selectObj) {
        this.model.standardName = selectObj.standardName
        this.model.maintenancePeriod = selectObj.maintenancePeriod
        this.model.standardCode = selectObj.standardCode
        // è‹¥å–消设备选择后保养周期为空则需清空点检日期和点检过期时间
        if (!this.model.equipmentId) {
          delete this.model.inspectionDate
          delete this.model.expirationTime
        } else {
          // å¦‚果点检日期存在,则在重新选择设备后即保养周期可能发生改变后重新计算过期时间
          if (this.model.inspectionDate) this.expirationTimeFrom(this.model.inspectionDate)
        }
        if (!this.standardType) {
          console.log('this.standardType', this.standardType)
          this.standardId = selectObj.id
          this.loadDetail(selectObj.id)
        }
        this.$nextTick(() => this.loadMaintenanceOperatorList(this.model.equipmentId))
      },
      expirationTimeFrom(date) {
        //过期时间是初始时间+保养周期
        if (date && this.model.maintenancePeriod) {
          // è½¬æ¢ä¸ºæ—¶é—´æˆ³å­—符串(或指定格式)
          this.model.expirationTime = moment(date)
            .add(this.model.maintenancePeriod, 'days')
            .format('YYYY-MM-DD')
        } else {
          this.model.expirationTime = null // æ¸…空无效值
        }
      },
      //加载详情数据
      loadDetail(standardId) {
        this.detail.dataSource = []
        if (standardId) {
          console.log('standardId', standardId)
          this.spinning = true
          getAction(this.url.detail, { standardId: standardId })
            .then(res => {
              if (res.success) {
                this.detail.dataSource = [...res.result]
              }
            })
            .finally(() => {
              this.spinning = false
            })
        }
      },
      loadDetailOrder(orderId) {
        if (orderId) {
          this.spinning = true
          getAction(this.url.detailOrder, { orderId: orderId })
            .then(res => {
              if (res.success) {
                this.detail.dataSource = [...res.result]
              }
            })
            .finally(() => {
              this.spinning = false
            })
        }
      },
      loadMaintenanceOperatorList(equipmentId) {
        this.maintenanceOperatorOptions = []
        let params = { positionCode: 'PCR0001' }
        if (equipmentId) {
          params.equipmentId = equipmentId
        } else {
          delete this.model.operator
          return
        }
        const that = this
        getAction(this.url.userSelect, params)
          .then(res => {
            if (res.success) {
              that.maintenanceOperatorOptions = res.result.map(item => ({
                key: item.id,
                value: item.username,
                text: item.realname
              }))
              if (!that.maintenanceOperatorOptions.find(item => item.value === that.model.operator)) delete that.model.operator
            } else {
              if (that.model.operator) delete that.model.operator
            }
          })
          .catch(err => {
            if (that.model.operator) delete that.model.operator
          })
      },
      handleCancel() {
        this.close()
      },
      close() {
        this.$emit('close')
        this.visible = false
        this.$refs.form.clearValidate()
      }
    }
  }
}
</script>
<style lang="less" scoped>
src/views/eam/maintenance/modules/EamInspectionOrderModalXq.vue
ÎļþÒÑɾ³ý
src/views/eam/maintenance/modules/EamWeekMaintenanceOrderModal.vue
@@ -5,70 +5,72 @@
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    :mask-closable="false"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
    <a-spin :spinning="spinning">
      <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderNum" label="工单号">
              <a-input placeholder="工单号系统自动生成" v-model="model.orderNum" disabled />
            <a-form-model-item prop="orderNum" label="工单号">
              <a-input placeholder="工单号系统自动生成" v-model="model.orderNum" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="设备编码">
            <a-form-model-item prop="equipmentId" label="设备编码">
              <maintenance-equipment-select placeholder="请输入设备编号或名称搜索" v-model="model.equipmentId"
                                            :maintenanceCategory="maintenanceCategory"
                                            @autocompleteForm="autocompleteForm" :disabled="editable"></maintenance-equipment-select>
                                            @autocompleteForm="autocompleteForm"
                                            :disabled="editable"></maintenance-equipment-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardName" label="标准名称">
              <a-input placeholder="选择设备后自动带出" v-model="model.standardName" disabled />
            <a-form-model-item prop="standardName" label="标准名称">
              <a-input placeholder="选择设备后自动带出" v-model="model.standardName" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenanceDate" label="保养日期">
            <a-form-model-item prop="maintenanceDate" label="保养日期">
              <a-date-picker placeholder="请选择计划保养日期" v-model="model.maintenanceDate" format="YYYY-MM-DD"
                             style="width: 100%" />
                             style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator" label="保养人">
              <j-search-select-tag v-model="model.operator" placeholder="请选择保养人"
                                 :dictOptions="maintenanceOperatorOptions" />
            <a-form-model-item prop="operator" label="保养人">
              <j-search-select-tag v-model="model.operator" placeholder="请选择保养人" :disabled="!model.equipmentId"
                                   :dictOptions="maintenanceOperatorOptions"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancePeriod" label="保养周期">
              <a-input placeholder="选择设备后自动带出" v-model="model.maintenancePeriod" disabled />
            <a-form-model-item prop="maintenancePeriod" label="保养周期">
              <a-input placeholder="选择设备后自动带出" v-model="model.maintenancePeriod" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="remark" label="备注">
            <a-textarea placeholder="请输入备注" v-model="model.remark" />
            <a-textarea placeholder="请输入备注" v-model="model.remark"/>
          </a-form-model-item>
        </a-row>
        <a-row :gutter="24">
          <j-vxe-table
            ref="editableDetailTable"
            :rowNumber="true"
            :rowSelection="true"
            :bordered="true"
            :alwaysEdit="true"
            :toolbar="true"
            :toolbarConfig="detail.toolbarConfig"
            keep-source
            :height="300"
            :loading="detail.loading"
            :dataSource="detail.dataSource"
            :columns="detail.columns"
            style="margin-top: 8px;" />
          <a-spin :spinning="detail.loading">
            <j-vxe-table
              ref="editableDetailTable"
              :rowNumber="true"
              :rowSelection="true"
              :bordered="true"
              :alwaysEdit="true"
              :toolbar="true"
              :toolbarConfig="detail.toolbarConfig"
              keep-source
              :height="300"
              :dataSource="detail.dataSource"
              :columns="detail.columns"
              style="margin-top: 8px;"/>
          </a-spin>
        </a-row>
      </a-form-model>
    </a-spin>
@@ -76,250 +78,266 @@
</template>
<script>
import { getAction, httpAction } from '@/api/manage'
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
import { JVXETypes } from '@comp/jeecg/JVxeTable'
import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect'
  import { getAction, httpAction } from '@/api/manage'
  import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
  import { JVXETypes } from '@comp/jeecg/JVxeTable'
  import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect'
export default {
  name: 'EamWeekMaintenanceOrderModal',
  mixins: [JVxeTableModelMixin],
  components: {
    MaintenanceEquipmentSelect
  },
  data() {
    return {
      title: '操作',
      visible: false,
      editable: false,
      model: {},
      maintenanceCategory: 'WEEK_MAINTENANCE',
      maintenanceOperatorOptions: [],
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      },
      labelColLong: {
        xs: { span: 24 },
        sm: { span: 2 }
      },
      wrapperColLong: {
        xs: { span: 24 },
        sm: { span: 21 }
      },
      confirmLoading: false,
      validatorRules: {
        equipmentId: [
          { required: true, message: '请选择设备!' }
        ],
        maintenanceDate: [
          { required: true, message: '请选择计划保养日期!' }
        ]
      },
      url: {
        add: '/eam/weekMaintenanceOrder/add',
        edit: '/eam/weekMaintenanceOrder/edit',
        standardDetail: '/eam/eamMaintenanceStandardDetail/queryList',
        detail: '/eam/weekMaintenanceOrderDetail/queryList',
        userSelect: '/eam/user_select/list',
      },
      detail: {
        loading: false,
        dataSource: [],
        columns: [
          {
            title: 'ID',
            key: 'id',
            type: JVXETypes.hidden
          },
          {
            title: 'orderId',
            key: 'orderId',
            type: JVXETypes.hidden
          },
          {
            title: '序号',
            key: 'itemCode',
            type: JVXETypes.inputNumber,
            width: '10%',
            align: 'center',
            validateRules: [
              { required: true, unique: true, message: '序号不能重复' }
            ]
          },
          {
            title: '保养项',
            key: 'itemName',
            type: JVXETypes.textarea,
            width: '20%',
            align: 'center',
            validateRules: [
              { required: true, message: '保养项不能为空!' }
            ]
          },
          {
            title: '子保养项',
            key: 'subItemName',
            type: JVXETypes.textarea,
            width: '25%',
            align: 'center'
          },
          {
            title: '保养要求',
            key: 'itemDemand',
            type: JVXETypes.textarea,
            width: '30%',
            align: 'center',
            validateRules: [
              { required: true, message: '保养要求不能为空!' }
            ]
          }
        ],
        toolbarConfig: {
          // prefix å‰ç¼€ï¼›suffix åŽç¼€
          slot: ['prefix', 'suffix'],
          // add æ–°å¢žæŒ‰é’®ï¼›remove åˆ é™¤æŒ‰é’®ï¼›clearSelection æ¸…空选择按钮
          btn: ['add', 'remove', 'clearSelection']
        }
      }
    }
  },
  created() {
  },
  methods: {
    add() {
      //初始化默认值
      this.model = {}
      this.visible = true
      this.editable = false
      this.detail.dataSource = []
      this.loadMaintenanceOperatorList();
  export default {
    name: 'EamWeekMaintenanceOrderModal',
    mixins: [JVxeTableModelMixin],
    components: {
      MaintenanceEquipmentSelect
    },
    edit(record) {
      this.model = Object.assign({}, record)
      this.visible = true
      this.editable = true
      this.detail.dataSource = []
      this.loadDetail(record.id)
    },
    close() {
      this.$emit('close')
      this.visible = false
      this.$refs.form.clearValidate()
    },
    async handleOk() {
      const that = this
      let errMap = await that.$refs.editableDetailTable.validateTable()
      if (errMap) {
        this.$message.warning('数据校验失败!')
        return
      }
      // è§¦å‘表单验证
      this.$refs.form.validate(valid => {
        if (valid) {
          let tableData = that.$refs.editableDetailTable.getTableData()
          let removeData = that.$refs.editableDetailTable.getDeleteData()
          that.model.tableDetailList = [...tableData]
          that.model.removeDetailList = [...removeData]
          that.confirmLoading = true
          let httpurl = ''
          let method = ''
          if (!this.model.id) {
            httpurl += this.url.add
            method = 'post'
          } else {
            httpurl += this.url.edit
            method = 'put'
          }
          httpAction(httpurl, this.model, method).then((res) => {
            if (res.success) {
              that.$message.success(res.message)
              that.$emit('ok')
              that.close()
            } else {
              that.$message.warning(res.message)
    data() {
      return {
        title: '操作',
        visible: false,
        editable: false,
        model: {},
        maintenanceCategory: 'WEEK_MAINTENANCE',
        maintenanceOperatorOptions: [],
        labelCol: {
          xs: { span: 24 },
          sm: { span: 6 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 }
        },
        labelColLong: {
          xs: { span: 24 },
          sm: { span: 2 }
        },
        wrapperColLong: {
          xs: { span: 24 },
          sm: { span: 21 }
        },
        confirmLoading: false,
        spinning: false,
        validatorRules: {
          equipmentId: [
            { required: true, message: '请选择设备!' }
          ],
          maintenanceDate: [
            { required: true, message: '请选择计划保养日期!' }
          ]
        },
        url: {
          add: '/eam/weekMaintenanceOrder/add',
          edit: '/eam/weekMaintenanceOrder/edit',
          standardDetail: '/eam/eamMaintenanceStandardDetail/queryList',
          detail: '/eam/weekMaintenanceOrderDetail/queryList',
          userSelect: '/eam/user_select/list'
        },
        detail: {
          loading: false,
          dataSource: [],
          columns: [
            {
              title: 'ID',
              key: 'id',
              type: JVXETypes.hidden
            },
            {
              title: 'orderId',
              key: 'orderId',
              type: JVXETypes.hidden
            },
            {
              title: '序号',
              key: 'itemCode',
              type: JVXETypes.inputNumber,
              width: '10%',
              align: 'center',
              validateRules: [
                { required: true, unique: true, message: '序号不能重复' }
              ]
            },
            {
              title: '保养项',
              key: 'itemName',
              type: JVXETypes.textarea,
              width: '20%',
              align: 'center',
              validateRules: [
                { required: true, message: '保养项不能为空!' }
              ]
            },
            {
              title: '子保养项',
              key: 'subItemName',
              type: JVXETypes.textarea,
              width: '25%',
              align: 'center'
            },
            {
              title: '保养要求',
              key: 'itemDemand',
              type: JVXETypes.textarea,
              width: '30%',
              align: 'center',
              validateRules: [
                { required: true, message: '保养要求不能为空!' }
              ]
            }
          }).finally(() => {
            that.confirmLoading = false
          })
        } else {
          return false
        }
      })
    },
    handleCancel() {
      this.close()
    },
    autocompleteForm(selectObj) {
      //标准名称,保养周期不刷新解决办法
      //办法一  validatorRules equipmentId è¿˜æ˜¯æœ‰é—®é¢˜
      // const newObj = {
      //   standardName: selectObj.standardName,
      //   maintenancePeriod: selectObj.maintenancePeriod,
      //   standardId : selectObj.id,
      //   equipmentId: selectObj.equipmentId,
      // };
      // this.model = Object.assign({}, newObj, this.model)
      //办法二
      this.$set(this.model, 'standardName', selectObj.standardName)
      this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod)
      this.$set(this.model, 'standardId', selectObj.id)
      this.$set(this.model, 'equipmentId', selectObj.equipmentId)
      // console.log('model', this.model)
      if (!this.model.id) {
        this.loadStandardDetail(selectObj.id)
      }
      this.loadMaintenanceOperatorList(this.model.equipmentId);
    },
    //加载详情数据
    loadStandardDetail(standardId) {
      if (standardId) {
        getAction(this.url.standardDetail, { standardId: standardId }).then(res => {
          if (res.success) {
            this.detail.dataSource = res.result.map(item => ({
              itemCode: item.itemCode,
              itemName: item.itemName,
              subItemName: item.subItemName,
              itemDemand: item.itemDemand
            }))
          ],
          toolbarConfig: {
            // prefix å‰ç¼€ï¼›suffix åŽç¼€
            slot: ['prefix', 'suffix'],
            // add æ–°å¢žæŒ‰é’®ï¼›remove åˆ é™¤æŒ‰é’®ï¼›clearSelection æ¸…空选择按钮
            btn: ['add', 'remove', 'clearSelection']
          }
        })
      }
    },
    //标准选择变化
    loadDetail(orderId) {
      if (orderId) {
        getAction(this.url.detail, { orderId: orderId }).then(res => {
          if (res.success) {
            this.detail.dataSource = [...res.result]
          }
        })
      }
    },
    loadMaintenanceOperatorList(equipmentId) {
      this.maintenanceOperatorOptions = []
      let params = { positionCode: 'PCR0001' }
      if (equipmentId) {
        params.equipmentId = equipmentId
      }
      getAction(this.url.userSelect, params).then(res => {
        if (res.success) {
          this.maintenanceOperatorOptions = res.result.map(item => ({
            key: item.id,
            value: item.username,
            text: item.realname
          }))
        }
      })
    }
      }
    },
    created() {
    },
    methods: {
      add() {
        //初始化默认值
        this.model = {}
        this.visible = true
        this.editable = false
        this.detail.dataSource = []
      },
      edit(record) {
        this.model = Object.assign({}, record)
        this.visible = true
        this.editable = true
        this.detail.dataSource = []
        this.loadDetail(record.id)
      },
      close() {
        this.$emit('close')
        this.visible = false
        this.$refs.form.clearValidate()
      },
      async handleOk() {
        const that = this
        let errMap = await that.$refs.editableDetailTable.validateTable()
        if (errMap) {
          this.$message.warning('数据校验失败!')
          return
        }
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            let tableData = that.$refs.editableDetailTable.getTableData()
            let removeData = that.$refs.editableDetailTable.getDeleteData()
            that.model.tableDetailList = [...tableData]
            that.model.removeDetailList = [...removeData]
            that.confirmLoading = true
            let httpurl = ''
            let method = ''
            if (!this.model.id) {
              httpurl += this.url.add
              method = 'post'
            } else {
              httpurl += this.url.edit
              method = 'put'
            }
            httpAction(httpurl, this.model, method).then((res) => {
              if (res.success) {
                that.$message.success(res.message)
                that.$emit('ok')
                that.close()
              } else {
                that.$message.warning(res.message)
              }
            }).finally(() => {
              that.confirmLoading = false
            })
          } else {
            return false
          }
        })
      },
      handleCancel() {
        this.close()
      },
      autocompleteForm(selectObj) {
        //标准名称,保养周期不刷新解决办法
        //办法一  validatorRules equipmentId è¿˜æ˜¯æœ‰é—®é¢˜
        // const newObj = {
        //   standardName: selectObj.standardName,
        //   maintenancePeriod: selectObj.maintenancePeriod,
        //   standardId : selectObj.id,
        //   equipmentId: selectObj.equipmentId,
        // };
        // this.model = Object.assign({}, newObj, this.model)
        //办法二
        this.$set(this.model, 'standardName', selectObj.standardName)
        this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod)
        this.$set(this.model, 'standardId', selectObj.id)
        this.$set(this.model, 'equipmentId', selectObj.equipmentId)
        // console.log('model', this.model)
        if (!this.model.equipmentId) delete this.model.operator
        if (!this.model.id) {
          this.loadStandardDetail(selectObj.id)
        }
        this.loadMaintenanceOperatorList(this.model.equipmentId)
      },
      //加载详情数据
      loadStandardDetail(standardId) {
        this.detail.dataSource = []
        if (standardId) {
          this.spinning = true
          getAction(this.url.standardDetail, { standardId: standardId })
            .then(res => {
              if (res.success) {
                this.detail.dataSource = res.result.map(item => ({
                  itemCode: item.itemCode,
                  itemName: item.itemName,
                  subItemName: item.subItemName,
                  itemDemand: item.itemDemand
                }))
              }
            })
            .finally(() => {
              this.spinning = false
            })
        }
      },
      //标准选择变化
      loadDetail(orderId) {
        if (orderId) {
          getAction(this.url.detail, { orderId: orderId }).then(res => {
            if (res.success) {
              this.detail.dataSource = [...res.result]
            }
          })
        }
      },
      loadMaintenanceOperatorList(equipmentId) {
        this.maintenanceOperatorOptions = []
        let params = { positionCode: 'PCR0001' }
        if (equipmentId) {
          params.equipmentId = equipmentId
        }
        else return
        const that = this
        getAction(this.url.userSelect, params)
          .then(res => {
            if (res.success) {
              that.maintenanceOperatorOptions = res.result.map(item => ({
                key: item.id,
                value: item.username,
                text: item.realname
              }))
              if (!that.maintenanceOperatorOptions.find(item => item.value === that.model.operator)) delete that.model.operator
            } else {
              if (that.model.operator) delete that.model.operator
            }
          })
          .catch(err => {
            if (that.model.operator) delete that.model.operator
          })
      }
    }
  }
}
</script>
<style lang="less" scoped>
src/views/flowable/workflow/FlowCompleted.vue
@@ -11,16 +11,19 @@
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="流程分类">
              <j-dict-select-tag placeholder="请选择流程分类" v-model="queryParam.category" dictCode="flow_type"></j-dict-select-tag>
              <j-dict-select-tag placeholder="请选择流程分类" v-model="queryParam.category"
                                 dictCode="flow_type"></j-dict-select-tag>
            </a-form-item>
          </a-col>
            <a-col :xl="10" :lg="11" :md="12" :sm="24">
              <a-form-item label="操作时间">
                <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.startTime"></j-date>
                <span class="query-group-split-cust"></span>
                <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.endTime"></j-date>
              </a-form-item>
            </a-col>
          <a-col :xl="10" :lg="11" :md="12" :sm="24">
            <a-form-item label="操作时间">
              <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust"
                      v-model="queryParam.startTime"></j-date>
              <span class="query-group-split-cust"></span>
              <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust"
                      v-model="queryParam.endTime"></j-date>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
@@ -53,7 +56,8 @@
        </template>
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
          <img v-else :src="getImgView(text)" height="25px" alt=""
               style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
@@ -75,164 +79,151 @@
      </a-table>
    </div>
    <AssignFileStreamXq ref="modalFormApproval" :selectShenpiData="selectShenpiData"></AssignFileStreamXq>
    <DispatchFileXq ref="modalFormDispatchFileXq"  :selectShenpiData="selectDispatchFileXqData"></DispatchFileXq>
    <InspectionOrderXq ref="modalFormInspectionOrderXq"  :selectShenpiData="selectInspectionOrderXqData"></InspectionOrderXq>
    <inspection-order-handle ref="modalFormInspectionOrderXq" :selectShenpiData="selectInspectionOrderXqData"/>
  </a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
import AssignFileStreamXq from '@views/flowable/workflow/assignFileStream/AssignFileStreamXq.vue'
import DispatchFileXq from '@views/flowable/workflow/dispatchFile/DispatchFileXq.vue'
import InspectionOrderXq from '@views/flowable/workflow/InspectionOrder/InspectionOrderXq.vue'
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
  import InspectionOrderHandle from './InspectionOrder/InspectionOrderHandle'
export default {
  name: 'NcDeviceCharactersList',
  mixins:[JeecgListMixin, mixinDevice],
  components: {
    InspectionOrderXq,
    DispatchFileXq,
    AssignFileStreamXq: AssignFileStreamXq,
    JDictSelectTag,
  },
  data () {
    return {
      description: '设备特殊字符管理页面',
      // è¡¨å¤´
      columns: [
        {
          title: '序号',
          dataIndex: '',
          key:'rowIndex',
          width:200,
          align:"center",
          customRender:function (t,r,index) {
            return parseInt(index)+1;
          }
        },
        {
          title: '流程分类',
          align: "center",
          dataIndex: 'category_dictText',
          width: 200,
        },
        {
          title: '流程名称',
          align: "center",
          dataIndex: 'procDefName',
          width: 200,
        },
        {
          title: '流程业务简要描述',
          align: "center",
          dataIndex: 'description',
          width:300
        },
        {
          title: '流程发起人名称',
          align: "center",
          dataIndex: 'startUserName',
          width: 250,
        },
        {
          title: '任务名称',
          align: "center",
          dataIndex: 'taskName',
          width:250
        },
        {
          title: '操作时间',
          align: "center",
          dataIndex: 'finishTime',
          width:300
        },
        {
          title: '操作',
          dataIndex: 'action',
          scopedSlots: { customRender: 'action' },
          align: 'center',
          width: 200,
          fixed: 'right'
        }
      ],
      url: {
        list: "/assign/flow/finishedList",
      },
      dictOptions:{},
      selectShenpiData: {},
      selectDispatchFileXqData:{},
      selectInspectionOrderXqData:{}
    }
  },
  created() {
  },
  computed: {
    importExcelUrl: function(){
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  export default {
    name: 'NcDeviceCharactersList',
    mixins: [JeecgListMixin, mixinDevice],
    components: {
      InspectionOrderHandle,
      JDictSelectTag
    },
  },
  methods: {
    handelDetial(item, index) {
      console.log('点击了详情')
      console.log('item----->', item)
      console.log('index----->', index)
      let approcesstype = this.splitAprocessType(item.category)
      console.log('approcesstype--->', approcesstype)
      switch (approcesstype) {
        case 'drApproval':
          this.handDrDetial(item)
          break
        case 'ggApproval':
          this.handDispatchFileDetial(item)
          break
        case 'sbdjApproval':
          this.handInspectionOrder(item)
          break
        default:
          alert('没找到该流程')
    data() {
      return {
        description: '设备特殊字符管理页面',
        // è¡¨å¤´
        columns: [
          {
            title: '序号',
            dataIndex: '',
            key: 'rowIndex',
            width: 200,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '流程分类',
            align: 'center',
            dataIndex: 'category_dictText',
            width: 200
          },
          {
            title: '流程名称',
            align: 'center',
            dataIndex: 'procDefName',
            width: 200
          },
          {
            title: '流程业务简要描述',
            align: 'center',
            dataIndex: 'description',
            width: 300
          },
          {
            title: '流程发起人名称',
            align: 'center',
            dataIndex: 'startUserName',
            width: 250
          },
          {
            title: '任务名称',
            align: 'center',
            dataIndex: 'taskName',
            width: 250
          },
          {
            title: '操作时间',
            align: 'center',
            dataIndex: 'finishTime',
            width: 300
          },
          {
            title: '操作',
            dataIndex: 'action',
            scopedSlots: { customRender: 'action' },
            align: 'center',
            width: 200,
            fixed: 'right'
          }
        ],
        url: {
          list: '/assign/flow/finishedList'
        },
        dictOptions: {},
        selectShenpiData: {},
        selectDispatchFileXqData: {},
        selectInspectionOrderXqData: {}
      }
    },
    splitAprocessType(title) {
      let parts = title.split(':') // æ³¨æ„å†’号是全角字符,使用对应的字进行分割
      let result = parts[0]
      return result
    created() {
    },
    handDrDetial(item) {
      this.selectShenpiData = item
      this.$refs.modalFormApproval.clearTableSource()
      this.$refs.modalFormApproval.getAllApproveData(item)
    computed: {
      importExcelUrl: function() {
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
      }
    },
    handDispatchFileDetial(item){
      console.log('item----->', item)
      this.selectDispatchFileXqData = item
      this.selectDispatchFileXqData.assignee_dictText=item.todoUsers_dictText
      this.selectDispatchFileXqData.procInstId=item.procInsId
      this.selectDispatchFileXqData.processInstanceId=item.procInsId
      this.selectDispatchFileXqData.title=item.description
      this.$refs.modalFormDispatchFileXq.clearTableSource()
      this.$refs.modalFormDispatchFileXq.getAllApproveData(item)
    },
    handInspectionOrder(item) {
      console.log('item----->', item)
      this.selectInspectionOrderXqData = item
      this.selectInspectionOrderXqData.assignee_dictText=item.todoUsers_dictText
      this.selectInspectionOrderXqData.procInstId=item.procInsId
      this.selectInspectionOrderXqData.processInstanceId=item.procInsId
      this.selectInspectionOrderXqData.title=item.description
      this.$refs.modalFormInspectionOrderXq.clearTableSource()
      this.$refs.modalFormInspectionOrderXq.getAllApproveData(item)
    methods: {
      handelDetial(item, index) {
        console.log('点击了详情')
        console.log('item----->', item)
        console.log('index----->', index)
        let approcesstype = this.splitAprocessType(item.category)
        console.log('approcesstype--->', approcesstype)
        switch (approcesstype) {
          case 'sbdjApproval':
            this.handInspectionOrder(item)
            break
          case 'WEEK_MAINTENANCE':
            this.handleWeekMaintenance(item)
            break
          default:
            alert('没找到该流程')
        }
      },
      splitAprocessType(title) {
        let parts = title.split(':') // æ³¨æ„å†’号是全角字符,使用对应的字进行分割
        let result = parts[0]
        return result
      },
      handleWeekMaintenance() {
      },
      handInspectionOrder(record) {
        console.log('record----->', record)
        this.selectInspectionOrderXqData = Object.assign({}, record)
        const { todoUsers_dictText, procInsId, description, taskName } = this.selectInspectionOrderXqData
        this.selectInspectionOrderXqData.assignee_dictText = todoUsers_dictText
        this.selectInspectionOrderXqData.procInstId = procInsId
        this.selectInspectionOrderXqData.processInstanceId = procInsId
        this.selectInspectionOrderXqData.title = description
        this.$refs.modalFormInspectionOrderXq.visible = true
        this.$refs.modalFormInspectionOrderXq.title = taskName
        this.$refs.modalFormInspectionOrderXq.disableSubmit = true
        this.$refs.modalFormInspectionOrderXq.getAllApproveData({
          ...record,
          procInstId: procInsId,
          processInstanceId: procInsId
        })
        this.$refs.modalFormInspectionOrderXq.getBasicInformation(record)
      }
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
  @import '~@assets/less/common.less';
</style>
src/views/flowable/workflow/FlowLedger.vue
@@ -9,11 +9,12 @@
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
        <a-col :xl="6" :lg="7" :md="8" :sm="24">
          <a-form-item label="流程分类">
            <j-dict-select-tag placeholder="请选择流程分类" v-model="queryParam.category" dictCode="flow_type"></j-dict-select-tag>
          </a-form-item>
        </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="流程分类">
              <j-dict-select-tag placeholder="请选择流程分类" v-model="queryParam.category"
                                 dictCode="flow_type"></j-dict-select-tag>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="流程名称">
              <a-input placeholder="请输入流程名称" v-model="queryParam.flowName"></a-input>
@@ -24,13 +25,15 @@
              <a-input placeholder="请输入简要描述" v-model="queryParam.title"></a-input>
            </a-form-item>
          </a-col>
        <a-col :xl="10" :lg="11" :md="12" :sm="24">
          <a-form-item label="操作时间">
            <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.startTime"></j-date>
            <span class="query-group-split-cust"></span>
            <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.endTime"></j-date>
          </a-form-item>
        </a-col>
          <a-col :xl="10" :lg="11" :md="12" :sm="24">
            <a-form-item label="操作时间">
              <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust"
                      v-model="queryParam.startTime"></j-date>
              <span class="query-group-split-cust"></span>
              <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust"
                      v-model="queryParam.endTime"></j-date>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
@@ -59,212 +62,162 @@
        :loading="loading"
        class="j-table-force-nowrap"
        @change="handleTableChange">
        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            ä¸‹è½½
          </a-button>
        </template>
        <span slot="action" slot-scope="text, record">
            <a @click="handelDetial(record,text)">详情</a>
            <a @click="handelDetail(record,text)">详情</a>
        </span>
      </a-table>
    </div>
    <AssignFileStreamXq ref="modalFormApproval" :selectShenpiData="selectShenpiData"></AssignFileStreamXq>
    <DispatchFileXq ref="modalFormDispatchFileXq"  :selectShenpiData="selectDispatchFileXqData"></DispatchFileXq>
    <InspectionOrderXq ref="modalFormInspectionOrderXq"  :selectShenpiData="selectInspectionOrderXqData"></InspectionOrderXq>
    <inspection-order-handle ref="modalFormInspectionOrderXq" :selectShenpiData="selectInspectionOrderXqData"/>
  </a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
import AssignFileStreamXq from '@views/flowable/workflow/assignFileStream/AssignFileStreamXq.vue'
import DispatchFileXq from '@views/flowable/workflow/dispatchFile/DispatchFileXq.vue'
import InspectionOrderXq from '@views/flowable/workflow/InspectionOrder/InspectionOrderXq.vue'
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
  import InspectionOrderHandle from './InspectionOrder/InspectionOrderHandle'
export default {
  name: 'NcDeviceCharactersList',
  mixins:[JeecgListMixin, mixinDevice],
  components: {
    DispatchFileXq,
    AssignFileStreamXq: AssignFileStreamXq,
    JDictSelectTag,
    InspectionOrderXq
  },
  data () {
    return {
      description: '设备特殊字符管理页面',
      // è¡¨å¤´
      columns: [
        {
          title: '序号',
          dataIndex: '',
          key:'rowIndex',
          align:"center",
          customRender:function (t,r,index) {
            return parseInt(index)+1;
          }
        },
        {
          title: '流程分类',
          align: "center",
          dataIndex: 'category_dictText',
          width: 200,
        },
        {
          title:'流程名称',
          align:"center",
          dataIndex: 'flowName'
        },
        {
          title:'流程业务简要描述',
          align:"center",
          dataIndex: 'title'
        },
        {
          title:'申请人',
          align:"center",
          dataIndex: 'proposer_dictText'
        },
        {
          title: '前驱节点',
          align: "center",
          dataIndex: 'preNode',
        },
        {
          title:'当前节点',
          align:"center",
          dataIndex: 'taskName'
        },
        {
          title:'流程开始时间',
          align:"center",
          dataIndex: 'startTime'
        },
        {
          title:'流程结束时间',
          align:"center",
          dataIndex: 'endTime'
        },
        {
          title:'处理时长',
          align:"center",
          dataIndex: 'duration'
        },
        {
          title:'当前任务人',
          align:"center",
          dataIndex: 'todoUsers_dictText'
        },
        {
          title:'处理过的人',
          align:"center",
          dataIndex: 'doneUsers_dictText'
        },
        {
          title: '操作',
          dataIndex: 'action',
          scopedSlots: { customRender: 'action' },
          align: 'center',
          width: 200,
          fixed: 'right'
        }
      ],
      url: {
        list: "/assign/flow/list",
      },
      dictOptions:{},
      selectShenpiData: {},
      selectDispatchFileXqData:{},
      selectInspectionOrderXqData:{}
    }
  },
  created() {
  },
  computed: {
    importExcelUrl: function(){
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  export default {
    name: 'FlowLedger',
    mixins: [JeecgListMixin, mixinDevice],
    components: {
      InspectionOrderHandle,
      JDictSelectTag
    },
  },
  methods: {
    handelDetial(item, index) {
      console.log('点击了详情')
      console.log('item----->', item)
      console.log('index----->', index)
      let approcesstype = this.splitAprocessType(item.category)
      console.log('approcesstype--->', approcesstype)
      switch (approcesstype) {
        case 'drApproval':
          item.description=item.title
          this.handDrDetial(item)
          break
        case 'ggApproval':
          item.description=item.title
          this.handDispatchFileDetial(item)
          break
        case 'sbdjApproval':
          item.description=item.title
          this.handInspectionOrderDetial(item)
          break
        default:
          alert('没找到该流程')
    data() {
      return {
        description: '流程管理',
        // è¡¨å¤´
        columns: [
          {
            title: '序号',
            dataIndex: '',
            key: 'rowIndex',
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '流程分类',
            align: 'center',
            dataIndex: 'category_dictText',
            width: 200
          },
          {
            title: '流程名称',
            align: 'center',
            dataIndex: 'flowName'
          },
          {
            title: '流程业务简要描述',
            align: 'center',
            dataIndex: 'title'
          },
          {
            title: '申请人',
            align: 'center',
            dataIndex: 'proposer_dictText'
          },
          {
            title: '前驱节点',
            align: 'center',
            dataIndex: 'preNode'
          },
          {
            title: '当前节点',
            align: 'center',
            dataIndex: 'taskName'
          },
          {
            title: '流程开始时间',
            align: 'center',
            dataIndex: 'startTime'
          },
          {
            title: '流程结束时间',
            align: 'center',
            dataIndex: 'endTime'
          },
          {
            title: '处理时长',
            align: 'center',
            dataIndex: 'duration'
          },
          {
            title: '当前任务人',
            align: 'center',
            dataIndex: 'todoUsers_dictText'
          },
          {
            title: '处理过的人',
            align: 'center',
            dataIndex: 'doneUsers_dictText'
          },
          {
            title: '操作',
            dataIndex: 'action',
            scopedSlots: { customRender: 'action' },
            align: 'center',
            width: 200,
            fixed: 'right'
          }
        ],
        url: {
          list: '/assign/flow/list'
        },
        dictOptions: {},
        selectShenpiData: {},
        selectDispatchFileXqData: {},
        selectInspectionOrderXqData: {}
      }
    },
    splitAprocessType(title) {
      let parts = title.split(':') // æ³¨æ„å†’号是全角字符,使用对应的字进行分割
      let result = parts[0]
      return result
    created() {
    },
    handDrDetial(item) {
      this.selectShenpiData = item
      this.selectShenpiData.assignee_dictText=item.todoUsers_dictText
      this.selectShenpiData.createTime=item.startTime
      this.selectShenpiData.procInstId=item.processInstanceId
      this.$refs.modalFormApproval.clearTableSource()
      this.$refs.modalFormApproval.getAllApproveData(item)
    computed: {
      importExcelUrl: function() {
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
      }
    },
    handDispatchFileDetial(item){
      this.selectDispatchFileXqData = item
      this.selectDispatchFileXqData.assignee_dictText=item.todoUsers_dictText
      this.selectDispatchFileXqData.createTime=item.startTime
      this.selectDispatchFileXqData.procInstId=item.processInstanceId
      this.$refs.modalFormDispatchFileXq.clearTableSource()
      this.$refs.modalFormDispatchFileXq.getAllApproveData(item)
    },
    handInspectionOrderDetial(item){
      this.selectInspectionOrderXqData = item
      this.selectInspectionOrderXqData.assignee_dictText=item.todoUsers_dictText
      this.selectInspectionOrderXqData.createTime=item.startTime
      this.selectInspectionOrderXqData.procInstId=item.processInstanceId
      this.$refs.modalFormInspectionOrderXq.clearTableSource()
      this.$refs.modalFormInspectionOrderXq.getAllApproveData(item)
    methods: {
      handelDetail(item, index) {
        console.log('点击了详情')
        console.log('item----->', item)
        console.log('index----->', index)
        let approcesstype = this.splitAprocessType(item.category)
        console.log('approcesstype--->', approcesstype)
        switch (approcesstype) {
          case 'sbdjApproval':
            item.description = item.title
            this.handInspectionOrderDetail(item)
            break
          default:
            alert('没找到该流程')
        }
      },
      splitAprocessType(title) {
        let parts = title.split(':') // æ³¨æ„å†’号是全角字符,使用对应的字进行分割
        let result = parts[0]
        return result
      },
      handInspectionOrderDetail(item) {
        this.selectInspectionOrderXqData = item
        this.selectInspectionOrderXqData.assignee_dictText = item.todoUsers_dictText
        this.selectInspectionOrderXqData.createTime = item.startTime
        this.selectInspectionOrderXqData.procInstId = item.processInstanceId
        this.$refs.modalFormInspectionOrderXq.visible = true
        this.$refs.modalFormInspectionOrderXq.disableSubmit = true
        this.$refs.modalFormInspectionOrderXq.getAllApproveData(item)
        this.$refs.modalFormInspectionOrderXq.getBasicInformation(item)
      }
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
  @import '~@assets/less/common.less';
</style>
src/views/flowable/workflow/FlowTodo.vue
@@ -82,22 +82,16 @@
        @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
            <a @click="handelDetail(record,text)">查看详情</a>
            <a @click="handelDetail(record,text)">执行/审批</a>
        </span>
      </a-table>
    </div>
    <AssignFileStreamHandle ref="modalFormApproval" :selectShenpiData="selectShenpiData"></AssignFileStreamHandle>
    <DispatchFileHandle ref="modalFormDispatchFileXq" :selectShenpiData="selectDispatchFileXqData"
                        @searchReset="searchReset"></DispatchFileHandle>
    <DispatchFileBachHandleStyle ref="modalFormDispatchFileBatch" @searchReset="searchReset"
                                 @ok="modalFormOk"></DispatchFileBachHandleStyle>
    <InspectionOrderHandle ref="modalFormInspectionOrder" :selectShenpiData="selectInspectionOrderData"
                           @searchReset="searchReset"></InspectionOrderHandle>
    <InspectionOrderHandleBzz ref="modalFormInspectionOrderBzz" :selectShenpiData="selectInspectionOrderDataBzz"
                              @searchReset="searchReset"></InspectionOrderHandleBzz>
    <week-maintenance-approval-modal ref="weekMaintenanceApprovalModal" @searchReset="searchReset"></week-maintenance-approval-modal>
    <week-maintenance-approval-modal ref="weekMaintenanceApprovalModal" :selectShenpiData="selectWeekMaintenanceData"
                                     @searchReset="searchReset"></week-maintenance-approval-modal>
    <repair-order-approval-modal ref="repairOrderApprovalModal" @searchReset="searchReset"
                                 :selectShenpiData="selectRepairOrderData"></repair-order-approval-modal>
  </a-card>
@@ -109,13 +103,9 @@
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
  import AssignFileStreamHandle from '@views/flowable/workflow/assignFileStream/AssignFileStreamHandle.vue'
  import DispatchFileHandle from '@views/flowable/workflow/dispatchFile/DispatchFileHandle.vue'
  import DispatchFileBachHandleStyle from '@views/flowable/workflow/dispatchFile/DispatchFileBachHandleStyle#Drawer.vue'
  import WeekMaintenanceApprovalModal from '@views/flowable/workflow/weekMaintenance/WeekMaintenanceApprovalModal'
  import RepairOrderApprovalModal from '@views/flowable/workflow/repairOrder/RepairOrderApprovalModal'
  import InspectionOrderHandle from '@views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue'
  import InspectionOrderHandleBzz from '@views/flowable/workflow/InspectionOrder/InspectionOrderHandleBzz.vue'
  import { getAction } from '@api/manage'
@@ -123,14 +113,10 @@
    name: 'NcDeviceCharactersList',
    mixins: [JeecgListMixin, mixinDevice],
    components: {
      AssignFileStreamHandle,
      JDictSelectTag,
      DispatchFileHandle,
      DispatchFileBachHandleStyle,
      WeekMaintenanceApprovalModal,
      RepairOrderApprovalModal,
      InspectionOrderHandle,
      InspectionOrderHandleBzz
      InspectionOrderHandle
    },
    data() {
      return {
@@ -205,10 +191,8 @@
          isSameNode: '/assign/flow/isSameNode'
        },
        dictOptions: {},
        selectShenpiData: {},
        selectDispatchFileXqData: {},
        selectInspectionOrderData: {},
        selectInspectionOrderDataBzz: {},
        selectWeekMaintenanceData: {},
        selectBachData: {},
        selectRepairOrderData: {},
        //业务信息ID
@@ -233,12 +217,6 @@
        let processType = this.splitAprocessType(item.category)
        console.log('processType--->', processType)
        switch (processType) {
          case 'drApproval':
            this.handDrDetail(item)
            break
          case 'ggApproval':
            this.handDispatchFileDetail(item)
            break
          case 'sbdjApproval':
            this.handInspectionOrder(item)
            break
@@ -257,34 +235,16 @@
        let result = parts[0]
        return result
      },
      handDrDetail(record) {
        this.selectShenpiData = Object.assign({}, record)
        this.$refs.modalFormApproval.visible = true
        this.$refs.modalFormApproval.getAllApproveData(record)
      },
      searchReset() {
        this.queryParam = {}
        this.loadData(1)
      },
      handDispatchFileDetail(item) {
        console.log('item----->', item)
        this.selectDispatchFileXqData = item
        this.$refs.modalFormDispatchFileXq.clearTableSource()
        this.$refs.modalFormDispatchFileXq.getAllApproveData(item)
      },
      handInspectionOrder(record) {
        console.log('record----->', record)
        const tableRecord = Object.assign({}, record)
        if (record.taskDefKey === 'Confirmed_completed') {
          this.selectInspectionOrderDataBzz = tableRecord
          this.$refs.modalFormInspectionOrderBzz.getAllApproveData(record)
        } else {
          this.selectInspectionOrderData = tableRecord
          this.$refs.modalFormInspectionOrder.visible = true
          this.$refs.modalFormInspectionOrder.getAllApproveData(record)
          this.$refs.modalFormInspectionOrder.getBasicInformation(record)
        }
        this.selectInspectionOrderData = Object.assign({}, record)
        this.$refs.modalFormInspectionOrder.visible = true
        this.$refs.modalFormInspectionOrder.title = record.name
        this.$refs.modalFormInspectionOrder.getAllApproveData(record)
        this.$refs.modalFormInspectionOrder.getBasicInformation(record)
      },
      batchHandle() {
        if (this.selectedRowKeys.length <= 0) {
          this.$notification.warning({
@@ -314,8 +274,10 @@
          })
        }
      },
      handleWeekMaintenance(item) {
        if (item && item.dataId) {
          this.selectWeekMaintenanceData = Object.assign({}, item)
          this.$refs.weekMaintenanceApprovalModal.handleDetail(item)
          this.$refs.weekMaintenanceApprovalModal.title = item.name
          this.$refs.weekMaintenanceApprovalModal.disableSubmit = false
src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue
@@ -1,115 +1,93 @@
<template>
  <a-modal
    :width="1000"
  <j-modal
    :title="title"
    :width="1200"
    :visible="visible"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit||!hasInspectionDateArrived} }"
    @ok="submitForm"
    @cancel="handCancel"
    @cancel="handleCancel"
    :mask-closable="false"
    :confirmLoading="confirmLoading"
    switchFullscreen
    centered
  >
    <a-card :bordered="false">
      <div>
        <b>{{ selectShenpiData.title }}</b>
        <br>
        <br>
        <a-tag color="blue">
          å½“前处理人 {{ selectShenpiData.assignee_dictText }}
        </a-tag>
        <a-tag color="blue">
          ä»»åŠ¡åˆ›å»ºæ—¶é—´ {{ selectShenpiData.createTime }}
        </a-tag>
        <br>
        <br>
        <a-button @click="fetchAndShowBmp" class="btn-custom" :loading="showBmpButtonLoading">流程图</a-button>
        <div v-if="imageSrc&&isDisplayBmp">
          <img :src="imageSrc" alt="Fetched Image"/>
        </div>
        <!--<hr class="shallow-hr">-->
      </div>
    <a-spin :spinning="spinning">
      <a-form-model ref='form' :model='tableRowRecord' :labelCol="labelCol" :wrapperCol="wrapperCol"
                    :rules="validatorRules">
        <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> ç‚¹æ£€åŸºç¡€ä¿¡æ¯</a-divider>
      <a-spin :spinning="spinning">
        <a-tabs default-active-key='1'>
          <a-tab-pane key='1' tab='基本信息'>
            <a-form-model ref='form' :model='tableRowRecord' :labelCol="labelCol"
                          :wrapperCol="wrapperCol">
              <a-row>
                <a-col :span='span'>
                  <a-form-model-item label="工单号">
                    <a-input readOnly v-model="tableRowRecord.orderNum"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span='span'>
                  <a-form-model-item label="设备编号">
                    <MaintenanceEquipmentSelect v-model="tableRowRecord.equipmentId"
                                                :maintenanceCategory="'POINT_INSPECTION'" disabled
                                                @autocompleteForm="autoCompleteForm"/>
                  </a-form-model-item>
                </a-col>
              </a-row>
        <a-row>
          <a-col :span='span'>
            <a-form-model-item label="工单号">
              <a-input readOnly v-model="tableRowRecord.orderNum"/>
            </a-form-model-item>
          </a-col>
          <a-col :span='span'>
            <a-form-model-item label="设备编号">
              <MaintenanceEquipmentSelect v-model="tableRowRecord.equipmentId"
                                          :maintenanceCategory="'POINT_INSPECTION'" disabled
                                          @autocompleteForm="autoCompleteForm"/>
            </a-form-model-item>
          </a-col>
          <a-col :span='span'>
            <a-form-model-item label="标准名称">
              <a-input readOnly v-model="tableRowRecord.standardName"/>
            </a-form-model-item>
          </a-col>
        </a-row>
              <a-row>
                <a-col :span='span'>
                  <a-form-model-item label="标准名称">
                    <a-input readOnly v-model="tableRowRecord.standardName"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span='span'>
                  <a-form-model-item label="标准编码">
                    <a-input readOnly v-model="tableRowRecord.standardCode"/>
                  </a-form-model-item>
                </a-col>
              </a-row>
              <a-row>
                <a-col :span='span'>
                  <a-form-model-item label="保养周期">
                    <a-input v-model="tableRowRecord.maintenancePeriod" readOnly/>
                  </a-form-model-item>
                </a-col>
                <a-col :span='span'>
                  <a-form-model-item label="点检人">
                    <a-input v-model="tableRowRecord.operator" readOnly/>
                  </a-form-model-item>
                </a-col>
              </a-row>
              <a-row>
                <a-col :span='span'>
                  <a-form-model-item label="点检日期" prop="inspectionDate">
                    <a-input v-model="tableRowRecord.inspectionDate" readOnly/>
                  </a-form-model-item>
                </a-col>
                <a-col :span='span'>
                  <a-form-model-item label="点检过期时间">
                    <a-input v-model="tableRowRecord.expirationTime" readOnly/>
                  </a-form-model-item>
                </a-col>
              </a-row>
              <a-row>
                <a-col :span="24">
                  <a-form-model-item label="备注" :labelCol="{span:3}" :wrapperCol="{span:20}">
                    <a-textarea v-model="tableRowRecord.remark" rows="3" readOnly/>
                  </a-form-model-item>
                </a-col>
              </a-row>
            </a-form-model>
          </a-tab-pane>
          <a-tab-pane key='2' tab='流程节点'>
            <a-card :bordered="false">
              <a-timeline>
                <a-timeline-item v-for="(item,index) in hitaskDataSource" :key="index">
                  <div>
                    <h3 style="font-weight: bold;">{{item.taskName}}</h3>
                    <div>处理人:{{item.assignee_dictText}}</div>
                    <div v-if="index !==0">处理时长:{{item.duration}}</div>
                    <div v-if="item.name !== '提交申请'">处理类型:{{item.sequenceFlowName}}</div>
                    <div v-if="item.description">处理意见:{{item.description}}</div>
                  </div>
                </a-timeline-item>
              </a-timeline>
            </a-card>
          </a-tab-pane>
        </a-tabs>
        <a-row>
          <a-col :span='span'>
            <a-form-model-item label="标准编码">
              <a-input readOnly v-model="tableRowRecord.standardCode"/>
            </a-form-model-item>
          </a-col>
          <a-col :span='span'>
            <a-form-model-item label="点检日期">
              <a-input v-model="tableRowRecord.inspectionDate" readOnly/>
            </a-form-model-item>
          </a-col>
          <a-col :span='span'>
            <a-form-model-item label="点检过期时间">
              <a-input v-model="tableRowRecord.expirationTime" readOnly/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-tabs default-active-key='1'>
        <a-row>
          <a-col :span='span'>
            <a-form-model-item label="保养周期">
              <a-input v-model="tableRowRecord.maintenancePeriod" readOnly/>
            </a-form-model-item>
          </a-col>
          <a-col :span='span'>
            <a-form-model-item label="点检人">
              <a-input v-model="tableRowRecord.operator" readOnly/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="span*3">
            <a-form-model-item label="备注" :labelCol="{span:2}" :wrapperCol="{span:21}">
              <a-textarea v-model="tableRowRecord.remark" rows="3" readOnly/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-form-model-item prop="imageFilesResult" label="点检图片" :labelCol="{span:2}" :wrapperCol="{span:21}">
            <lx-upload :returnUrl="false" :isMultiple="true" file-type="image" :number="3"
                       :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='UNDER_INSPECTION'"
                       v-model="tableRowRecord.imageFiles"/>
          </a-form-model-item>
        </a-row>
        <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">
          ä¿å…»é¡¹ä¿¡æ¯
        </a-divider>
        <a-tabs v-model="activeTabKey">
          <a-tab-pane key="1" tab="保养项明细">
            <j-vxe-table
              ref="editableDetailTable"
@@ -127,6 +105,7 @@
            >
              <template v-slot:inspectionResult="props">
                <j-dict-select-tag v-model="props.row.inspectionResult" dictCode="eam_inspection_result"
                                   :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='UNDER_INSPECTION'"
                                   placeholder="请选择点检结果"
                                   @change="handleInspectionResultSelectChange($event,props.row)"
                                   style="width: 100%"/>
@@ -134,20 +113,46 @@
              <template v-slot:exceptionDescription="props">
                <a-textarea style="height: 32px" v-model="props.row.exceptionDescription"
                            :disabled="!props.row.inspectionResult||props.row.inspectionResult==='1'"/>
                            :placeholder="props.row.inspectionResult==='2'?'请输入异常描述':''"
                            :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='UNDER_INSPECTION'||!props.row.inspectionResult||props.row.inspectionResult==='1'"/>
              </template>
              <template v-slot:reportFlag="props">
                <j-dict-select-tag v-model="props.row.reportFlag"
                                   :disabled="!props.row.inspectionResult||props.row.inspectionResult==='1'"
                                   :placeholder="props.row.inspectionResult==='2'?'请选择异常是否保修':''"
                                   :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='UNDER_INSPECTION'||!props.row.inspectionResult||props.row.inspectionResult==='1'"
                                   dictCode="yn"
                                   style="width: 100%"/>
              </template>
            </j-vxe-table>
          </a-tab-pane>
          <a-button v-if="selectedRowKeys.length>0" slot="tabBarExtraContent" type="primary"
                    @click="handleSelectAllInspectionResult">批量点检正常
          <template v-if="selectShenpiData.procInstId">
            <a-tab-pane key='2' tab='流程节点'>
              <a-card :bordered="false">
                <a-timeline>
                  <a-timeline-item v-for="(item,index) in hitaskDataSource" :key="index">
                    <div>
                      <h3 style="font-weight: bold;">{{item.taskName}}</h3>
                      <div>处理人:{{item.assignee_dictText}}</div>
                      <div v-if="index !==0">处理时长:{{item.duration}}</div>
                      <div v-if="item.name !== '提交申请'">处理类型:{{item.sequenceFlowName}}</div>
                      <div v-if="item.description">处理意见:{{item.description}}</div>
                    </div>
                  </a-timeline-item>
                </a-timeline>
              </a-card>
            </a-tab-pane>
            <a-tab-pane key='3' tab='流程图'>
              <img :src="imageSrc" alt="Fetched Image"/>-->
            </a-tab-pane>
          </template>
          <a-button
            v-if="selectedRowKeys.length>0&&!disableSubmit&&tableRowRecord.inspectionStatus==='UNDER_INSPECTION'&&hasInspectionDateArrived&&activeTabKey==='1'"
            slot="tabBarExtraContent" type="primary"
            @click="handleSelectAllInspectionResult">批量点检正常
          </a-button>
          <!--<a-dropdown slot="tabBarExtraContent" v-if="selectedRowKeys.length>0">-->
@@ -161,9 +166,32 @@
          <!--</a-button>-->
          <!--</a-dropdown>-->
        </a-tabs>
      </a-spin>
    </a-card>
  </a-modal>
        <template v-if="isDisplayConfirm">
          <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> ç­ç»„长确认信息
          </a-divider>
          <a-row :gutter="24">
            <a-col :span="12">
              <a-form-model-item prop="confirmDealType" label="处理类型">
                <j-dict-select-tag type='radio' v-model='tableRowRecord.confirmDealType' dictCode='approved_rejected'
                                   :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='WAIT_CONFIRM'"
                                   placeholder="请选择处理类型"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item prop="confirmComment" label="处理意见">
                <a-textarea placeholder="请输入处理意见"
                            :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='WAIT_CONFIRM'"
                            v-model="tableRowRecord.confirmComment"/>
              </a-form-model-item>
            </a-col>
          </a-row>
        </template>
      </a-form-model>
    </a-spin>
  </j-modal>
</template>
<script>
@@ -171,22 +199,32 @@
  import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage'
  import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect.vue'
  import { JVXETypes } from '@comp/jeecg/JVxeTable'
  import moment from 'moment'
  export default {
    name: 'InspectionOrderHandle',
    components: { MaintenanceEquipmentSelect },
    props: {
      selectShenpiData: {
        type: Object,
        required: true
        type: Object
      }
    },
    data() {
      return {
        span: 12,
        span: 8,
        confirmLoading: false,
        spinning: false,
        tableRowRecord: {},
        assignFileStream: {},
        hitaskDataSource: [],
        validatorRules: {
          confirmDealType: [
            { required: true, message: '请选择处理类型' }
          ],
          confirmComment: [
            { required: true, message: '请输入处理意见' }
          ]
        },
        imageSrc: null,
        labelCol: {
          xs: { span: 24 },
@@ -212,7 +250,7 @@
              title: '序号',
              key: 'itemCode',
              type: JVXETypes.normal,
              width: '10%',
              width: '5%',
              align: 'center',
              fixed: 'left'
            },
@@ -220,7 +258,7 @@
              title: '保养项',
              key: 'itemName',
              type: JVXETypes.normal,
              width: '20%',
              width: '15%',
              align: 'center',
              fixed: 'left'
            },
@@ -228,7 +266,7 @@
              title: '保养要求',
              key: 'itemDemand',
              type: JVXETypes.normal,
              width: '30%',
              width: '15%',
              align: 'center',
              fixed: 'left'
            },
@@ -237,16 +275,22 @@
              key: 'inspectionResult',
              type: JVXETypes.slot,
              slotName: 'inspectionResult',
              width: '20%',
              align: 'center'
              width: '15%',
              align: 'center',
              validateRules: [
                { required: true, message: '${title}不能为空!' }
              ]
            },
            {
              title: '异常描述',
              key: 'exceptionDescription',
              type: JVXETypes.slot,
              slotName: 'exceptionDescription',
              width: '30%',
              align: 'center'
              width: '20%',
              align: 'center',
              validateRules: [
                { handler: this.customValidator }
              ]
            },
            {
              title: '异常是否报修',
@@ -254,13 +298,27 @@
              type: JVXETypes.slot,
              slotName: 'reportFlag',
              width: '20%',
              align: 'center'
              align: 'center',
              validateRules: [
                { handler: this.customValidator }
              ]
            }
          ]
        },
        isDisplayBmp: false,
        showBmpButtonLoading: false,
        selectedRowKeys: []
        selectedRowKeys: [],
        disableSubmit: false,
        activeTabKey: '1',
        title: ''
      }
    },
    computed: {
      hasInspectionDateArrived() {
        return moment(this.tableRowRecord.inspectionDate).diff(moment(), 'hours') <= 0
      },
      isDisplayConfirm() {
        return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.inspectionStatus)
      }
    },
    methods: {
@@ -269,11 +327,29 @@
       * @param record å¾…办记录信息
       */
      getAllApproveData(record) {
        const param = { 'procInstId': record.procInstId }
        getAction(this.url.queryHisTaskList, param)
          .then(res => {
            this.hitaskDataSource = res.result
          })
        if (record.procInstId) {
          const { processDefinitionId, processInstanceId, processDefinitionKey, procInstId } = record
          const param = { procInstId }
          const imageParam = { processDefinitionId, processInstanceId, TaskDefinitionKey: processDefinitionKey }
          const that = this
          getAction(this.url.queryHisTaskList, param)
            .then(res => {
              that.hitaskDataSource = res.result
            })
          downFile(this.url.diagramView, imageParam, 'get')
            .then((res => {
              const urlObject = window.URL.createObjectURL(new Blob([res]))
              that.imageSrc = urlObject
            }))
            .catch(err => {
              that.$notification.error({
                message: '消息',
                description: res.message
              })
            })
        }
      },
      /**
@@ -281,6 +357,7 @@
       * @param record å¾…办记录信息
       */
      getBasicInformation(record) {
        this.activeTabKey = '1'
        this.tableRowRecord = {}
        this.detail.dataSource = []
        this.spinning = true
@@ -290,62 +367,52 @@
          .then((res => {
            if (res.success) {
              that.tableRowRecord = res.result[0]
              if (!this.hasInspectionDateArrived && !this.disableSubmit) this.title += `(未到点检日期不能提前点检)`
              that.detail.dataSource = res.result[0].tableDetailList
              console.log('that.tableRowRecord----->', that.tableRowRecord)
            }
          }))
      },
      // èŽ·å–å¹¶å±•å¼€æµç¨‹å›¾
      fetchAndShowBmp() {
        this.isDisplayBmp = !this.isDisplayBmp
        if (!this.imageSrc) {
          const { processDefinitionId, processInstanceId, processDefinitionKey } = this.selectShenpiData
          let param = { processDefinitionId, processInstanceId, TaskDefinitionKey: processDefinitionKey }
          this.showBmpButtonLoading = true
          const that = this
          downFile(this.url.diagramView, param, 'get')
            .then((res => {
              const urlObject = window.URL.createObjectURL(new Blob([res]))
              this.imageSrc = urlObject
            }))
            .catch(err => {
              that.$notification.error({
                message: '消息',
                description: res.message
              })
            })
            .finally(() => {
              this.showBmpButtonLoading = false
            })
      async submitForm() {
        let errMap = await this.$refs.editableDetailTable.validateTable()
        if (errMap) {
          console.log('err', errMap)
          return
        }
      },
      submitForm() {
        const flowTaskVo = {}
        flowTaskVo.dataId = this.selectShenpiData.dataId
        flowTaskVo.taskId = this.selectShenpiData.id
        flowTaskVo.userId = this.selectShenpiData.assignee
        flowTaskVo.instanceId = this.selectShenpiData.procInstId
        flowTaskVo.values = this.selectShenpiData.variables
        flowTaskVo.tableDetailList = this.$refs.editableDetailTable.getTableData()
        const that = this
        this.confirmLoading = true
        console.log('表单提交数据', flowTaskVo)
        // httpAction(this.url.approve, flowTaskVo, 'post')
        //   .then((res) => {
        //     if (res.success) {
        //       that.$message.success(res.message)
        //       //刷新表格
        //       that.$emit('searchReset')
        //       that.handleCancel()
        //     } else {
        //       that.$message.warning(res.message)
        //     }
        //   })
        //   .finally(() => {
        //     that.confirmLoading = false
        //   })
        this.$refs.form.validate(valid => {
          if (valid) {
            this.confirmLoading = this.spinning = true
            const flowTaskVo = {}
            flowTaskVo.dataId = this.selectShenpiData.dataId
            flowTaskVo.taskId = this.selectShenpiData.id
            flowTaskVo.userId = this.selectShenpiData.assignee
            flowTaskVo.instanceId = this.selectShenpiData.procInstId
            flowTaskVo.values = this.selectShenpiData.variables
            flowTaskVo.confirmDealType = this.tableRowRecord.confirmDealType
            flowTaskVo.confirmComment = this.tableRowRecord.confirmComment
            flowTaskVo.tableDetailList = this.$refs.editableDetailTable.getTableData()
            const that = this
            console.log('表单提交数据', flowTaskVo)
            httpAction(this.url.approve, flowTaskVo, 'post')
              .then((res) => {
                if (res.success) {
                  that.$message.success(res.message)
                  //刷新表格
                  that.$emit('searchReset')
                  that.handleCancel()
                } else {
                  that.$message.warning(res.message)
                }
              })
              .finally(() => {
                that.confirmLoading = this.spinning = false
              })
          } else {
            return false
          }
        })
      },
      autoCompleteForm({ standardName, maintenancePeriod, standardCode }) {
@@ -360,7 +427,6 @@
        this.selectedRowKeys.forEach(key => {
          const dataItem = this.detail.dataSource.find(item => item.id === key)
          if (dataItem && dataItem.inspectionResult !== '1') {
            console.log('dataItem', dataItem)
            delete dataItem.exceptionDescription
            delete dataItem.reportFlag
            dataItem.inspectionResult = '1'
@@ -388,7 +454,19 @@
        if (record.reportFlag) delete record.reportFlag
      },
      handCancel() {
      customValidator({ cellValue, row }, callback) {
        if (row.inspectionResult === '2') {
          if (!cellValue) {
            callback(false, '${title}不能为空!') // false = æœªé€šè¿‡ï¼Œå¯ä»¥è·Ÿè‡ªå®šä¹‰æç¤º
          } else {
            callback(true) // true = é€šè¿‡éªŒè¯
          }
        } else {
          callback(true)
        }
      },
      handleCancel() {
        this.selectedRowKeys = []
        this.visible = false
      }
src/views/flowable/workflow/InspectionOrder/InspectionOrderHandleBzz.vue
ÎļþÒÑɾ³ý
src/views/flowable/workflow/InspectionOrder/InspectionOrderXq.vue
ÎļþÒÑɾ³ý
src/views/flowable/workflow/assignFileStream/AssignFileStreamHandle.vue
ÎļþÒÑɾ³ý
src/views/flowable/workflow/assignFileStream/AssignFileStreamXq.vue
ÎļþÒÑɾ³ý
src/views/flowable/workflow/dispatchFile/DispatchFileBachHandleForm.vue
ÎļþÒÑɾ³ý
src/views/flowable/workflow/dispatchFile/DispatchFileBachHandleStyle#Drawer.vue
ÎļþÒÑɾ³ý
src/views/flowable/workflow/dispatchFile/DispatchFileHandle.vue
ÎļþÒÑɾ³ý
src/views/flowable/workflow/dispatchFile/DispatchFileXq.vue
ÎļþÒÑɾ³ý
src/views/flowable/workflow/weekMaintenance/WeekMaintenanceApprovalModal.vue
@@ -8,16 +8,17 @@
    switchFullscreen
    @ok="handleOk"
    @cancel="handleCancel"
    centered
    cancelText="关闭">
    <a-spin :spinning="confirmLoading">
    <a-spin :spinning="spinning">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
        <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> ä¿å…»åŸºç¡€ä¿¡æ¯
        </a-divider>
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderNum" label="工单号">
              <a-input placeholder="工单号系统自动生成" v-model="model.orderNum" disabled />
              <a-input placeholder="工单号系统自动生成" v-model="model.orderNum" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
@@ -30,7 +31,7 @@
          </a-col>
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardName" label="标准名称">
              <a-input placeholder="选择设备后自动带出" v-model="model.standardName" disabled />
              <a-input placeholder="选择设备后自动带出" v-model="model.standardName" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -39,24 +40,24 @@
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenanceDate" label="保养日期">
              <a-date-picker placeholder="请选择计划保养日期" v-model="model.maintenanceDate" format="YYYY-MM-DD"
                             disabled
                             style="width: 100%" />
                             style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator" label="保养人">
              <j-search-select-tag v-model="model.operator" placeholder="请选择保养人" disabled
                                   :dictOptions="maintenanceOperatorOptions" />
                                   :dictOptions="maintenanceOperatorOptions"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancePeriod" label="保养周期">
              <a-input placeholder="选择设备后自动带出" v-model="model.maintenancePeriod" disabled />
              <a-input placeholder="选择设备后自动带出" v-model="model.maintenancePeriod" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="remark" label="备注">
            <a-textarea placeholder="请输入备注" v-model="model.remark" disabled />
            <a-textarea placeholder="请输入备注" v-model="model.remark" disabled/>
          </a-form-model-item>
        </a-row>
        <a-row :gutter="24">
@@ -65,13 +66,13 @@
                       :isMultiple="true"
                       file-type="image"
                       :disabled="confirmDisable"
                       v-model="model.imageFilesResult" />
                       v-model="model.imageFilesResult"/>
          </a-form-model-item>
        </a-row>
        <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> ä¿å…»é¡¹ä¿¡æ¯
        </a-divider>
        <a-row :gutter="24">
          <a-tabs>
          <a-tabs v-model="activeTabKey">
            <a-tab-pane key="1" tab="保养项明细">
              <j-vxe-table
                ref="editableDetailTable"
@@ -92,39 +93,44 @@
                                     placeholder="请选择保养结果"
                                     :disabled="disableSubmit || confirmDisable"
                                     @change="handleInspectionResultSelectChange($event,props.row)"
                                     style="width: 100%" />
                                     style="width: 100%"/>
                </template>
                <template v-slot:exceptionDescription="props">
                  <a-textarea style="height: 32px" v-model="props.row.exceptionDescription"
                              :disabled="disableSubmit || confirmDisable || !props.row.maintenanceResult || props.row.maintenanceResult === '1'" />
                              :disabled="disableSubmit || confirmDisable || !props.row.maintenanceResult || props.row.maintenanceResult === '1'"/>
                </template>
                <template v-slot:reportFlag="props">
                  <j-dict-select-tag v-model="props.row.reportFlag"
                                     :disabled="disableSubmit || confirmDisable || !props.row.maintenanceResult || props.row.maintenanceResult === '1'"
                                     dictCode="yn"
                                     style="width: 100%" />
                                     style="width: 100%"/>
                </template>
              </j-vxe-table>
            </a-tab-pane>
            <a-tab-pane v-if="!disableSubmit" key='2' tab='流程节点'>
              <a-card :bordered="false">
                <a-timeline>
                  <a-timeline-item v-for="(item,index) in taskData" :key="index">
                    <div>
                      <h3 style="font-weight: bold;">{{item.taskName}}</h3>
                      <div>处理人:{{item.assignee_dictText}}</div>
                      <div v-if="index !==0">处理时长:{{item.duration}}</div>
                      <div v-if="item.name !== '提交申请'">处理类型:{{item.sequenceFlowName}}</div>
                      <div v-if="item.description">处理意见:{{item.description}}</div>
                    </div>
                  </a-timeline-item>
                </a-timeline>
              </a-card>
            </a-tab-pane>
            <a-button v-if="!disableSubmit || selectedRowKeys.length > 0" slot="tabBarExtraContent" type="primary"
                      @click="handleSelectAllInspectionResult">保养正常
            <template v-if="selectShenpiData.procInstId">
              <a-tab-pane key='2' tab='流程节点'>
                <a-card :bordered="false">
                  <a-timeline>
                    <a-timeline-item v-for="(item,index) in taskData" :key="index">
                      <div>
                        <h3 style="font-weight: bold;">{{item.taskName}}</h3>
                        <div>处理人:{{item.assignee_dictText}}</div>
                        <div v-if="index !==0">处理时长:{{item.duration}}</div>
                        <div v-if="item.name !== '提交申请'">处理类型:{{item.sequenceFlowName}}</div>
                        <div v-if="item.description">处理意见:{{item.description}}</div>
                      </div>
                    </a-timeline-item>
                  </a-timeline>
                </a-card>
              </a-tab-pane>
              <a-tab-pane key='3' tab='流程图'>
                <img :src="imageSrc" alt="Fetched Image"/>-->
              </a-tab-pane>
            </template>
            <a-button v-if="!disableSubmit &&!confirmDisable&& selectedRowKeys.length > 0" slot="tabBarExtraContent"
                      type="primary" @click="handleSelectAllInspectionResult">保养正常
            </a-button>
          </a-tabs>
        </a-row>
@@ -134,12 +140,14 @@
          <a-row :gutter="24">
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmDealType" label="确认类型">
                <j-dict-select-tag  type='radio' v-model='model.confirmDealType' dictCode='approved_rejected' placeholder="请选择处理类型" :disabled="disableSubmit || initialAcceptanceDisable" />
                <j-dict-select-tag type='radio' v-model='model.confirmDealType' dictCode='approved_rejected'
                                   placeholder="请选择处理类型" :disabled="disableSubmit || initialAcceptanceDisable"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment" label="确认意见">
                <a-textarea placeholder="请输入意见" v-model="model.confirmComment" :disabled="disableSubmit || initialAcceptanceDisable" />
                <a-textarea placeholder="请输入意见" v-model="model.confirmComment"
                            :disabled="disableSubmit || initialAcceptanceDisable"/>
              </a-form-model-item>
            </a-col>
          </a-row>
@@ -149,16 +157,19 @@
          </a-divider>
          <a-row :gutter="24">
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="initialAcceptanceComment" label="初验收意见">
                <a-textarea placeholder="请输入意见" v-model="model.initialAcceptanceComment" :disabled="disableSubmit || finalAcceptanceDisable" />
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="initialAcceptanceComment"
                                 label="初验收意见">
                <a-textarea placeholder="请输入意见" v-model="model.initialAcceptanceComment"
                            :disabled="disableSubmit || finalAcceptanceDisable"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="initialAcceptanceFilesResult" label="初验收附件">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="initialAcceptanceFilesResult"
                                 label="初验收附件">
                <lx-upload :returnUrl="false"
                           :isMultiple="true"
                           :disabled="disableSubmit || finalAcceptanceDisable"
                           v-model="model.initialAcceptanceFilesResult" />
                           v-model="model.initialAcceptanceFilesResult"/>
              </a-form-model-item>
            </a-col>
          </a-row>
@@ -168,16 +179,19 @@
          </a-divider>
          <a-row :gutter="24">
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="finalAcceptanceComment" label="终验收意见">
                <a-textarea placeholder="请输入意见" v-model="model.finalAcceptanceComment" :disabled="disableSubmit || completionDisable" />
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="finalAcceptanceComment"
                                 label="终验收意见">
                <a-textarea placeholder="请输入意见" v-model="model.finalAcceptanceComment"
                            :disabled="disableSubmit || completionDisable"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="finalAcceptanceFilesResult" label="终验收附件">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="finalAcceptanceFilesResult"
                                 label="终验收附件">
                <lx-upload :returnUrl="false"
                           :isMultiple="true"
                           :disabled="disableSubmit || completionDisable"
                           v-model="model.finalAcceptanceFilesResult" />
                           v-model="model.finalAcceptanceFilesResult"/>
              </a-form-model-item>
            </a-col>
          </a-row>
@@ -188,339 +202,386 @@
</template>
<script>
import { getAction, httpAction } from '@/api/manage'
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
import { JVXETypes } from '@comp/jeecg/JVxeTable'
import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect'
  import { downFile, getAction, httpAction } from '@/api/manage'
  import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
  import { JVXETypes } from '@comp/jeecg/JVxeTable'
  import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect'
export default {
  name: 'WeekMaintenanceApprovalModal',
  mixins: [JVxeTableModelMixin],
  components: {
    MaintenanceEquipmentSelect
  },
  data() {
    return {
      title: '操作',
      visible: false,
      //状态控制
      //保养中 ä¸å¯ç¼–辑
      // confirmDisable: false,
      // initialAcceptanceDisable: false,
      // finalAcceptanceDisable: false,
      editable: false,
      model: {},
      maintenanceCategory: 'WEEK_MAINTENANCE',
      maintenanceOperatorOptions: [],
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      },
      labelColLong: {
        xs: { span: 24 },
        sm: { span: 2 }
      },
      wrapperColLong: {
        xs: { span: 24 },
        sm: { span: 21 }
      },
      confirmLoading: false,
      validatorRules: {
        confirmDealType: [
          { required: true, message: '请选择通过或驳回!' }
        ],
        confirmComment: [
          { required: true, message: '请输入确认意见!' }
        ],
        initialAcceptanceComment: [
          { required: true, message: '请输入初验收意见!' }
        ],
        finalAcceptanceComment: [
          { required: true, message: '请输入终验收意见!' }
        ],
      },
      url: {
        queryById: '/eam/weekMaintenanceOrder/queryById',
        detail: '/eam/weekMaintenanceOrderDetail/queryList',
        approval: '/eam/weekMaintenanceOrder/approval',
        userSelect: '/eam/user_select/list',
        queryHisTaskList: '/assign/flow/queryHisTaskList',
      },
      disableSubmit: false,
      taskData: [],
      isDisplayBmp: false,
      showBmpButtonLoading: false,
      selectedRowKeys: [],
      detail: {
        loading: false,
        dataSource: [],
        columns: [
          {
            title: 'ID',
            key: 'id',
            type: JVXETypes.hidden
          },
          {
            title: 'orderId',
            key: 'orderId',
            type: JVXETypes.hidden
          },
          {
            title: '序号',
            key: 'itemCode',
            type: JVXETypes.normal,
            width: '5%',
            align: 'center'
          },
          {
            title: '保养项',
            key: 'itemName',
            type: JVXETypes.normal,
            width: '10%',
            align: 'center'
          },
          {
            title: '子保养项',
            key: 'subItemName',
            type: JVXETypes.normal,
            width: '10%',
            align: 'center'
          },
          {
            title: '保养要求',
            key: 'itemDemand',
            type: JVXETypes.normal,
            width: '20%',
            align: 'center'
          },
          {
            title: '保养结果',
            key: 'maintenanceResult',
            type: JVXETypes.slot,
            width: '10%',
            align: 'center',
            slotName: 'maintenanceResult',
            validateRules: [
              { required: true, message: '保养结果不能为空!' }
            ]
          },
          {
            title: '异常描述',
            key: 'exceptionDescription',
            type: JVXETypes.slot,
            width: '20%',
            align: 'center',
            slotName: 'exceptionDescription',
          },
          {
            title: '是否报修',
            key: 'reportFlag',
            type: JVXETypes.slot,
            width: '10%',
            align: 'center',
            slotName: 'reportFlag',
  export default {
    name: 'WeekMaintenanceApprovalModal',
    mixins: [JVxeTableModelMixin],
    components: {
      MaintenanceEquipmentSelect
    },
    props: {
      selectShenpiData: {
        type: Object
      }
    },
    data() {
      return {
        title: '操作',
        visible: false,
        //状态控制
        //保养中 ä¸å¯ç¼–辑
        // confirmDisable: false,
        // initialAcceptanceDisable: false,
        // finalAcceptanceDisable: false,
        editable: false,
        model: {},
        maintenanceCategory: 'WEEK_MAINTENANCE',
        maintenanceOperatorOptions: [],
        labelCol: {
          xs: { span: 24 },
          sm: { span: 6 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 }
        },
        labelColLong: {
          xs: { span: 24 },
          sm: { span: 2 }
        },
        wrapperColLong: {
          xs: { span: 24 },
          sm: { span: 21 }
        },
        confirmLoading: false,
        spinning: false,
        imageSrc: null,
        activeTabKey: '1',
        validatorRules: {
          confirmDealType: [
            { required: true, message: '请选择通过或驳回!' }
          ],
          confirmComment: [
            { required: true, message: '请输入确认意见!' }
          ],
          initialAcceptanceComment: [
            { required: true, message: '请输入初验收意见!' }
          ],
          finalAcceptanceComment: [
            { required: true, message: '请输入终验收意见!' }
          ]
        },
        url: {
          queryById: '/eam/weekMaintenanceOrder/queryById',
          detail: '/eam/weekMaintenanceOrderDetail/queryList',
          approval: '/eam/weekMaintenanceOrder/approval',
          userSelect: '/eam/user_select/list',
          queryHisTaskList: '/assign/flow/queryHisTaskList',
          diagramView: '/assign/flow/diagramView'
        },
        disableSubmit: false,
        taskData: [],
        isDisplayBmp: false,
        showBmpButtonLoading: false,
        selectedRowKeys: [],
        detail: {
          loading: false,
          dataSource: [],
          columns: [
            {
              title: 'ID',
              key: 'id',
              type: JVXETypes.hidden
            },
            {
              title: 'orderId',
              key: 'orderId',
              type: JVXETypes.hidden
            },
            {
              title: '序号',
              key: 'itemCode',
              type: JVXETypes.normal,
              width: '5%',
              align: 'center'
            },
            {
              title: '保养项',
              key: 'itemName',
              type: JVXETypes.normal,
              width: '10%',
              align: 'center'
            },
            {
              title: '子保养项',
              key: 'subItemName',
              type: JVXETypes.normal,
              width: '10%',
              align: 'center'
            },
            {
              title: '保养要求',
              key: 'itemDemand',
              type: JVXETypes.normal,
              width: '20%',
              align: 'center'
            },
            {
              title: '保养结果',
              key: 'maintenanceResult',
              type: JVXETypes.slot,
              width: '10%',
              align: 'center',
              slotName: 'maintenanceResult',
              validateRules: [
                { required: true, message: '保养结果不能为空!' }
              ]
            },
            {
              title: '异常描述',
              key: 'exceptionDescription',
              type: JVXETypes.slot,
              width: '20%',
              align: 'center',
              slotName: 'exceptionDescription',
              validateRules: [
                { handler: this.customValidator }
              ]
            },
            {
              title: '是否报修',
              key: 'reportFlag',
              type: JVXETypes.slot,
              width: '10%',
              align: 'center',
              slotName: 'reportFlag',
              validateRules: [
                { handler: this.customValidator }
              ]
            }
          ],
          toolbarConfig: {
            // prefix å‰ç¼€ï¼›suffix åŽç¼€
            slot: ['prefix', 'suffix'],
            // add æ–°å¢žæŒ‰é’®ï¼›remove åˆ é™¤æŒ‰é’®ï¼›clearSelection æ¸…空选择按钮
            btn: ['clearSelection']
          }
        ],
        toolbarConfig: {
          // prefix å‰ç¼€ï¼›suffix åŽç¼€
          slot: ['prefix', 'suffix'],
          // add æ–°å¢žæŒ‰é’®ï¼›remove åˆ é™¤æŒ‰é’®ï¼›clearSelection æ¸…空选择按钮
          btn: ['clearSelection']
        }
      }
    }
  },
  created() {
  },
  computed: {
    confirmDisable: function(){
      return ['WAIT_CONFIRM', 'WAIT_INITIAL_ACCEPTANCE', 'WAIT_FINAL_ACCEPTANCE', 'COMPLETE'].includes(this.model.maintenanceStatus);
    },
    initialAcceptanceDisable: function() {
      return ['WAIT_INITIAL_ACCEPTANCE', 'WAIT_FINAL_ACCEPTANCE', 'COMPLETE'].includes(this.model.maintenanceStatus);
    created() {
    },
    finalAcceptanceDisable: function() {
      return ['WAIT_FINAL_ACCEPTANCE', 'COMPLETE'].includes(this.model.maintenanceStatus);
    computed: {
      confirmDisable: function() {
        return ['WAIT_CONFIRM', 'WAIT_INITIAL_ACCEPTANCE', 'WAIT_FINAL_ACCEPTANCE', 'COMPLETE'].includes(this.model.maintenanceStatus)
      },
      initialAcceptanceDisable: function() {
        return ['WAIT_INITIAL_ACCEPTANCE', 'WAIT_FINAL_ACCEPTANCE', 'COMPLETE'].includes(this.model.maintenanceStatus)
      },
      finalAcceptanceDisable: function() {
        return ['WAIT_FINAL_ACCEPTANCE', 'COMPLETE'].includes(this.model.maintenanceStatus)
      },
      completionDisable: function() {
        return ['COMPLETE', 'ABOLISH'].includes(this.model.maintenanceStatus)
      }
    },
    completionDisable: function() {
      return ['COMPLETE', 'ABOLISH'].includes(this.model.maintenanceStatus);
    }
  },
  methods: {
    async handleDetail(item) {
      this.loading = true
      this.visible = true
      this.detail.dataSource = []
      let taskDataList = await  getAction(this.url.queryHisTaskList, { procInstId: item.procInstId });
      this.taskData = [...taskDataList.result];
      let res = await getAction(this.url.queryById, {id: item.dataId})
      this.model = Object.assign({}, res.result)
      if(this.model.imageFiles) {
        let obj = JSON.parse(this.model.imageFiles);
        this.model.imageFilesResult = [...obj];
      }
      if(this.model.initialAcceptanceFiles) {
        let obj = JSON.parse(this.model.initialAcceptanceFiles);
        this.model.initialAcceptanceFilesResult = [...obj];
      }
      if(this.model.finalAcceptanceFiles) {
        let obj = JSON.parse(this.model.finalAcceptanceFiles);
        this.model.finalAcceptanceFilesResult = [...obj];
      }
      this.model.dataId = item.dataId
      this.model.taskId = item.id
      this.model.userId = item.assignee
      this.model.instanceId = item.procInstId
      this.model.values = item.variables
      await this.loadDetail(item.dataId)
      this.loading = false
    },
    recordDetail(record) {
      this.loading = true
      this.visible = true
      this.detail.dataSource = []
      this.model = Object.assign({}, record)
      if(this.model.imageFiles) {
        let obj = JSON.parse(this.model.imageFiles);
        this.model.imageFilesResult = [...obj];
      }
      if(this.model.initialAcceptanceFiles) {
        let obj = JSON.parse(this.model.initialAcceptanceFiles);
        this.model.initialAcceptanceFilesResult = [...obj];
      }
      if(this.model.finalAcceptanceFiles) {
        let obj = JSON.parse(this.model.finalAcceptanceFiles);
        this.model.finalAcceptanceFilesResult = [...obj];
      }
      this.loadDetail(record.id)
      this.loading = false
    },
    close() {
      this.$emit('close')
      this.visible = false
      this.$refs.form.clearValidate()
    },
    async handleOk() {
      const that = this
      let errMap = await that.$refs.editableDetailTable.validateTable()
      if (errMap) {
        this.$message.warning('数据校验失败!')
        return
      }
      // è§¦å‘表单验证
      this.$refs.form.validate(valid => {
        if (valid) {
          let tableData = that.$refs.editableDetailTable.getTableData();
    methods: {
      async handleDetail(item) {
        this.initParams()
        this.model = {}
        if (item.procInstId) {
          const { processDefinitionId, processInstanceId, processDefinitionKey, procInstId } = item
          let checkMsg = null;
          tableData.some(row => {
            if(!row.maintenanceResult) {
              checkMsg = '保养结果不能为空!';
              return true;
            }
            if(row.maintenanceResult === '2' && (!row.exceptionDescription || !row.reportFlag)) {
              checkMsg = '保养结果为异常,需要填写异常原因及是否报修!';
              return true;
            }
          })
          if(checkMsg) {
            that.$message.warning(checkMsg);
            return;
          }
          let taskDataList = await getAction(this.url.queryHisTaskList, { procInstId })
          this.taskData = [...taskDataList.result]
          that.model.tableDetailList = [...tableData]
          that.confirmLoading = true
          let httpurl = this.url.approval
          let method = 'put'
          httpAction(httpurl, this.model, method).then((res) => {
            if (res.success) {
              that.$message.success(res.message)
              that.$emit('searchReset')
              that.close()
            } else {
              that.$message.warning(res.message)
            }
          }).finally(() => {
            that.confirmLoading = false
          })
        } else {
          return false
          downFile(this.url.diagramView, {
            processDefinitionId,
            processInstanceId,
            TaskDefinitionKey: processDefinitionKey
          }, 'get')
            .then((res => {
              const urlObject = window.URL.createObjectURL(new Blob([res]))
              this.imageSrc = urlObject
            }))
            .catch(err => {
              this.$notification.error({
                message: '消息',
                description: res.message
              })
            })
        }
      })
    },
    handleCancel() {
      this.close()
    },
    autocompleteForm(selectObj) {
      this.$set(this.model, 'standardName', selectObj.standardName)
      this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod)
      this.$set(this.model, 'standardId', selectObj.id)
      this.$set(this.model, 'equipmentId', selectObj.equipmentId)
      // console.log('model', this.model)
      if (!this.model.id) {
        this.loadStandardDetail(selectObj.id)
      }
      this.loadMaintenanceOperatorList(this.model.equipmentId)
    },
    //标准选择变化
    loadDetail(orderId) {
      if (orderId) {
        getAction(this.url.detail, { orderId: orderId }).then(res => {
          if (res.success) {
            this.detail.dataSource = [...res.result]
        let res = await getAction(this.url.queryById, { id: item.dataId })
        this.model = Object.assign({}, res.result)
        if (this.model.imageFiles) {
          let obj = JSON.parse(this.model.imageFiles)
          this.model.imageFilesResult = [...obj]
        }
        if (this.model.initialAcceptanceFiles) {
          let obj = JSON.parse(this.model.initialAcceptanceFiles)
          this.model.initialAcceptanceFilesResult = [...obj]
        }
        if (this.model.finalAcceptanceFiles) {
          let obj = JSON.parse(this.model.finalAcceptanceFiles)
          this.model.finalAcceptanceFilesResult = [...obj]
        }
        this.model.dataId = item.dataId
        this.model.taskId = item.id
        this.model.userId = item.assignee
        this.model.instanceId = item.procInstId
        this.model.values = item.variables
        await this.loadDetail(item.dataId)
      },
      recordDetail(record) {
        this.initParams()
        this.model = Object.assign({}, record)
        if (this.model.imageFiles) {
          let obj = JSON.parse(this.model.imageFiles)
          this.model.imageFilesResult = [...obj]
        }
        if (this.model.initialAcceptanceFiles) {
          let obj = JSON.parse(this.model.initialAcceptanceFiles)
          this.model.initialAcceptanceFilesResult = [...obj]
        }
        if (this.model.finalAcceptanceFiles) {
          let obj = JSON.parse(this.model.finalAcceptanceFiles)
          this.model.finalAcceptanceFilesResult = [...obj]
        }
        this.loadDetail(record.id)
      },
      initParams() {
        this.detail.dataSource = []
        this.visible = true
        this.activeTabKey = '1'
        this.spinning = true
      },
      async handleOk() {
        const that = this
        let errMap = await that.$refs.editableDetailTable.validateTable()
        if (errMap) {
          this.$message.warning('数据校验失败!')
          return
        }
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            let tableData = that.$refs.editableDetailTable.getTableData()
            that.model.tableDetailList = [...tableData]
            that.confirmLoading = spinnning = true
            let httpurl = this.url.approval
            let method = 'put'
            httpAction(httpurl, this.model, method).then((res) => {
              if (res.success) {
                that.$message.success(res.message)
                that.$emit('searchReset')
                that.close()
              } else {
                that.$message.warning(res.message)
              }
            }).finally(() => {
              that.confirmLoading = spinning = false
            })
          } else {
            return false
          }
        })
      }
    },
    loadMaintenanceOperatorList(equipmentId) {
      this.maintenanceOperatorOptions = []
      let params = { positionCode: 'PCR0001' }
      if (equipmentId) {
        params.equipmentId = equipmentId
      }
      getAction(this.url.userSelect, params).then(res => {
        if (res.success) {
          this.maintenanceOperatorOptions = res.result.map(item => ({
            key: item.id,
            value: item.username,
            text: item.realname
          }))
      },
      autocompleteForm(selectObj) {
        this.$set(this.model, 'standardName', selectObj.standardName)
        this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod)
        this.$set(this.model, 'standardId', selectObj.id)
        this.$set(this.model, 'equipmentId', selectObj.equipmentId)
        // console.log('model', this.model)
        if (!this.model.id) {
          this.loadStandardDetail(selectObj.id)
        }
      })
    },
    handleInspectionResultSelectChange(value, record) {
      if (record.exceptionDescription) delete record.exceptionDescription
      if (record.reportFlag) delete record.reportFlag
    },
    // æ‰¹é‡é€‰æ‹©æ‰€æœ‰ç‚¹æ£€ç»“æžœ
    handleSelectAllInspectionResult() {
      this.selectedRowKeys.forEach(key => {
        const dataItem = this.detail.dataSource.find(item => item.id === key)
        if (dataItem && dataItem.maintenanceResult !== '1') {
          console.log('dataItem', dataItem)
          delete dataItem.exceptionDescription
          delete dataItem.reportFlag
          dataItem.maintenanceResult = '1'
        this.loadMaintenanceOperatorList(this.model.equipmentId)
      },
      //标准选择变化
      loadDetail(orderId) {
        if (orderId) {
          getAction(this.url.detail, { orderId: orderId })
            .then(res => {
              if (res.success) {
                this.detail.dataSource = [...res.result]
              }
            })
            .finally(() => {
              this.spinning = false
            })
        }
      })
      this.$refs.editableDetailTable.clearCheckboxRow()
      this.selectedRowKeys = []
    },
    /**
     * è¡¨æ ¼å¤šé€‰æ¡†å‘生改变时触发
     * @param {selectedRowIds} è¡¨æ ¼ä¸­å·²é€‰æ‹©çš„ID列表
     */
    handleTableSelectRowChange({ selectedRowIds }) {
      this.selectedRowKeys = selectedRowIds
    },
      },
      loadMaintenanceOperatorList(equipmentId) {
        this.maintenanceOperatorOptions = []
        let params = { positionCode: 'PCR0001' }
        if (equipmentId) {
          params.equipmentId = equipmentId
        }
        getAction(this.url.userSelect, params).then(res => {
          if (res.success) {
            this.maintenanceOperatorOptions = res.result.map(item => ({
              key: item.id,
              value: item.username,
              text: item.realname
            }))
          }
        })
      },
      handleInspectionResultSelectChange(value, record) {
        if (record.exceptionDescription) delete record.exceptionDescription
        if (record.reportFlag) delete record.reportFlag
      },
      // æ‰¹é‡é€‰æ‹©æ‰€æœ‰ç‚¹æ£€ç»“æžœ
      handleSelectAllInspectionResult() {
        this.selectedRowKeys.forEach(key => {
          const dataItem = this.detail.dataSource.find(item => item.id === key)
          if (dataItem && dataItem.maintenanceResult !== '1') {
            console.log('dataItem', dataItem)
            delete dataItem.exceptionDescription
            delete dataItem.reportFlag
            dataItem.maintenanceResult = '1'
          }
        })
        this.$refs.editableDetailTable.clearCheckboxRow()
        this.selectedRowKeys = []
      },
      /**
       * è¡¨æ ¼å¤šé€‰æ¡†å‘生改变时触发
       * @param {selectedRowIds} è¡¨æ ¼ä¸­å·²é€‰æ‹©çš„ID列表
       */
      handleTableSelectRowChange({ selectedRowIds }) {
        this.selectedRowKeys = selectedRowIds
      },
      customValidator({ cellValue, row }, callback) {
        if (row.maintenanceResult === '2') {
          if (!cellValue) {
            callback(false, '${title}不能为空!') // false = æœªé€šè¿‡ï¼Œå¯ä»¥è·Ÿè‡ªå®šä¹‰æç¤º
          } else {
            callback(true) // true = é€šè¿‡éªŒè¯
          }
        } else {
          callback(true)
        }
      },
      handleCancel() {
        this.close()
      },
      close() {
        this.$emit('close')
        this.visible = false
        this.$refs.form.clearValidate()
      }
    }
  }
}
</script>
<style lang="less" scoped>