“linengliang”
2023-11-24 5cbba170e270e6f1c99a91e27dbb7951a27d596a
故障报修验收
已添加1个文件
已修改2个文件
204 ■■■■ 文件已修改
src/views/eam/MalfunctionRepair.vue 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/equipmentNew/EquipmentModal.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/malfunctionRepair/AcceptModel.vue 141 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/MalfunctionRepair.vue
@@ -215,7 +215,11 @@
          slot="action"
          slot-scope="text, record"
        >
          <a-popconfirm
          <a
            :disabled=" record.status !== '4'"
            @click="handleAccept(record)"
          >验收</a>
          <!-- <a-popconfirm
            v-if="record.status == '1' || record.status == '4'"
            title="确认提交吗?"
            @confirm="() =>handleCommit(record, 'commit')"
@@ -271,9 +275,9 @@
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
          </a-dropdown> -->
        </span>
        <span slot="faultDescription" slot-scope="text">
        <span slot="jell" slot-scope="text">
            <j-ellipsis :value="text" :length="10" />
        </span>
@@ -307,6 +311,10 @@
      @ok='approvalModalFormOk'
      @cancel='approvalModalFormOk'
    ></approvel-modal>
    <accept-model
    ref="acceptModel"
    @ok="modalFormOk"
    ></accept-model>
  </a-card>
</template>
  
@@ -321,6 +329,7 @@
import ApprovelModal from './modules/malfunctionRepair/ApprovelModal'
import JEllipsis from '@/components/jeecg/JEllipsis'
import moment from 'moment'
import AcceptModel from './modules/malfunctionRepair/AcceptModel'
export default {
  name: 'MalfunctionRepairList',
@@ -329,7 +338,8 @@
    MalfunctionRepairModal,
    FaultDescriptionList,
    ApprovelModal,
    JEllipsis
    JEllipsis,
    AcceptModel,
  },
  data() {
    return {
@@ -430,24 +440,27 @@
          align: "center",
          dataIndex: 'createBy'
        },
        // {
        //   title: '创建时间',
        //   align: "center",
        //   dataIndex: 'createTime',
        // },
        {
          title: '验收意见',
          align: "center",
          dataIndex: 'errUda5',
          scopedSlots: {
            customRender: 'jell'
          }
        },
        {
          title: '备注',
          align: "center",
          dataIndex: 'remark'
        },
        // {
        //   title: '操作',
        //   dataIndex: 'action',
        //   align: "center",
        //   fixed: "right",
        //   width: 200,
        //   scopedSlots: { customRender: 'action' }
        // }
        {
          title: '操作',
          dataIndex: 'action',
          align: "center",
          fixed: "right",
          width: 200,
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: "/eam/equipmentReportRepair/getReportRepairList",
@@ -632,6 +645,10 @@
    timeChange(){
      this.queryParam.faultStartTime = moment(this.faultTime[0]).format("YYYY-MM-DD HH:mm:ss")
      this.queryParam.faultEndTime = moment(this.faultTime[1]).format("YYYY-MM-DD HH:mm:ss")
    },
    handleAccept(record){
      this.$refs.acceptModel.title="验收"
      this.$refs.acceptModel.edit(record)
    }
  }
}
src/views/eam/modules/equipmentNew/EquipmentModal.vue
@@ -117,15 +117,9 @@
              :wrapperCol="wrapperCol"
              prop="useId"
            >
              <!-- <a-tree-select
                style="width: 100%"
                :disabled="formDisabled"
                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                :tree-data="treeData"
                placeholder="请选择使用部门"
                tree-default-expand-all
                v-model="model.useId"
              /> -->
              <j-dict-select-tag
                allow-clear
                :disabled="formDisabled"
src/views/eam/modules/malfunctionRepair/AcceptModel.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,141 @@
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <a-spin :spinning="confirmLoading">
      <a-form-model
        ref="form"
        :model="model"
        :rules="validatorRules"
      >
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-model-item
              label="验收意见"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="errUda5"
            >
               <a-textarea v-model="model.remark" rows="4" placeholder="验收意见" />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-spin>
  </j-modal>
</template>
<script>
import { httpAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import pick from 'lodash.pick'
import { postAction, requestPut, getAction } from '@/api/manage'
import { duplicateCheck } from '@/api/api'
import moment from 'moment'
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
import { JVXETypes } from '@/components/jeecg/JVxeTable'
export default {
  name: "NodeModel",
  mixins: [JVxeTableModelMixin],
  components: {
    validateDuplicateValue,
  },
  props: {
    disableSubmit: {
      type: Boolean,
      default: false,
      required: false
    },
    caytegoryParam: {
      type: String,
      default: '',
      required: false
    }
  },
  data() {
    return {
      title: "操作",
      width: 1500,
      visible: false,
      model: {
      },
      labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
      },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
      },
      confirmLoading: false,
      validatorRules: {
        remark: [
          { min: 0, max: 100, message: '长度不超过 100 ä¸ªå­—符', trigger: 'blur' },
        ],
      },
      url: {
        accept: "/eam/equipmentReportRepair/accept",
      },
    }
  },
  created() {
    //备份model原始值
    this.initOptions();
    this.modelDefault = JSON.parse(JSON.stringify(this.model));
  },
  methods: {
    add() {
      this
      this.edit(this.modelDefault);
    },
    edit(record) {
      this.model = Object.assign({}, record);
      this.visible = true;
    },
    close() {
      this.$emit('close');
      this.visible = false;
      this.$refs.form.clearValidate();
    },
    handleOk() {
      const that = this;
      // è§¦å‘表单验证
      this.$refs.form.validate(valid => {
        if (valid) {
          that.confirmLoading = true;
          let httpurl = this.url.accept;
          let method = 'put';
          httpAction(httpurl, this.model, method).then((res) => {
            if (res.success) {
              that.$message.success(res.message);
              that.$emit('ok');
            } else {
              that.$message.warning(res.message);
            }
          }).finally(() => {
            that.confirmLoading = false;
            that.close();
          })
        } else {
          return false
        }
      })
    },
    handleCancel() {
      this.close()
    },
  },
  computed: {
    formDisabled() {
      return this.disableSubmit
    },
  },
}
</script>