cuijian
2023-10-16 2a4216c13dde3634c1df8de5b2367c7f299c19b3
维修工单问题修改
已添加1个文件
已修改4个文件
654 ■■■■■ 文件已修改
src/views/eam/MalfunctionRepair.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/RepairOrderList.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/dailyMaintenanceOrder/EquipmentCheckOrderModal.vue 593 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/malfunctionRepair/MalfunctionRepaireModal.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/repairorder/RepairOrderModal.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/MalfunctionRepair.vue
@@ -308,6 +308,11 @@
        //   scopedSlots: { customRender: 'imgSlot' }
        // },
        {
          title: '故障原因',
          align: "center",
          dataIndex: 'faultReason'
        },
        {
          title: '故障时间',
          align: "center",
          dataIndex: 'faultTime'
src/views/eam/RepairOrderList.vue
@@ -537,6 +537,26 @@
          align: "center",
          dataIndex: 'faultDescription'
        },
        {
          title: '故障原因',
          align: "center",
          dataIndex: 'faultReason'
        },
        {
          title: '故障现象',
          align: "center",
          dataIndex: 'faultPhenomenon'
        },
        {
          title: '故障排除',
          align: "center",
          dataIndex: 'faultRemove'
        },
        {
          title: '预防措施',
          align: "center",
          dataIndex: 'preventiveMeasure'
        },
        // {
        //   title: '故障时间',
        //   align: "center",
src/views/eam/modules/dailyMaintenanceOrder/EquipmentCheckOrderModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,593 @@
<template>
  <a-modal
    :width="1250"
    :visible="visible"
    :maskClosable="false"
    @ok="handleOk"
    cancelText="关闭"
    @cancel="handleCancel"
    :confirmLoading="confirmLoading"
  >
    <!-- :title="title" -->
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-divider
          orientation="center"
          style="font-size: large;font-style: normal;font-size: 30px;color: #66aeed;"
        > ç”Ÿäº§è®¾å¤‡ä¸‰çº§ä¿å…»éªŒæ”¶å• </a-divider>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="设备类别"
            >
              <span v-if="this.model != null">{{ this.model.equipmentName }}</span>
              <span v-else>-</span>
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="设备编号"
            >
              <span v-if="this.model != null">{{ this.model.equipmentNum }}</span>
              <span v-else>-</span>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="设备名称"
            >
              <span v-if="this.model != null">{{ this.model.equipmentName }}</span>
              <span v-else>-</span>
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="设备型号"
            >
              <span v-if="this.model != null">{{ this.model.equipmentModel }}</span>
              <span v-else>-</span>
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
    <a-table
      ref="table"
      bordered
      size="middle"
      rowKey='id'
      :columns="columns"
      :dataSource="dataSource"
    >
      <template
        v-for="col in columns"
        :slot="col.dataIndex"
        slot-scope='text, record, index'
      >
        <div :key="col.dataIndex">
          <a-input
            :value="text"
            v-if="col.dataIndex == 'actualMeasure'"
            auto-size
            placeholder="请输入实测值"
            @change="(e)=>handleChange(e, record.key, col, index)"
          />
        </div>
      </template>
    </a-table>
    <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
      <a-row :gutter="24">
        <a-col :span="12">
          <a-form-item
            :labelCol="labelCol"
            :wrapperCol="wrapperCol"
            label="精度检验者"
          >
            <span v-if="this.model != null">{{ this.model.precisionInspectionUserName}}</span>
            <span v-else>-</span>
          </a-form-item>
        </a-col>
        <a-col :span="12">
          <a-form-item
            :labelCol="labelCol"
            :wrapperCol="wrapperCol"
            label="维修室主任"
          >
            <span v-if="this.model != null">{{ this.model.repairDirectorUserName }}</span>
            <span v-else>-</span>
          </a-form-item>
        </a-col>
      </a-row>
    </div>
    <div :style="{height: '115px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '50px 20px',background: '#fff',}">
      <span
        class="ant-descriptions-title"
        style="font-size: large;font-style: normal;font-size: 15px;"
      >精度状态</span>
    </div>
    <div :style="{height: '115px',float: 'right',width: '90%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
      <a-row :gutter="24">
        <a-col :span="12">
          <a-form-item
            :labelCol="{ span: 8 }"
            :wrapperCol="{ span: 4 }"
            label="各项精度达到允差要求"
          >
            <a-switch
              checked-children="是"
              un-checked-children="否"
              :checked="model.eachTolerance == '1'"
              @change="handle2Switch(model.eachTolerance)"
            />
          </a-form-item>
        </a-col>
        <a-col :span="12">
          <a-form-item
            :labelCol="{ span: 8 }"
            :wrapperCol="{ span: 4 }"
            label="部分精度未达到允差要求"
          >
            <a-switch
              checked-children="是"
              un-checked-children="否"
              :checked="model.partTolerance == '1'"
              @change="handle3Switch(model.partTolerance)"
            />
          </a-form-item>
        </a-col>
      </a-row>
      <a-row :gutter="24">
        <a-col
          :style="{float: 'right'}"
          :span="12"
        >
          <a-form-item
            :labelCol="{ span: 8 }"
            :wrapperCol="{ span: 4 }"
            label="设备检验员"
          >
            <span v-if="this.model != null">{{ this.model.equipmentInspectorUserName }}</span>
            <span v-else>-</span>
          </a-form-item>
        </a-col>
      </a-row>
    </div>
    <div :style="{height: '115px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '50px 20px',background: '#fff',}">
      <span
        class="ant-descriptions-title"
        style="font-size: large;font-style: normal;font-size: 15px;"
      >零件状态</span>
    </div>
    <div :style="{height: '115px',float: 'right',width: '90%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
      <a-row :gutter="24">
        <a-col :span="12">
          <a-form-item
            :labelCol="{ span: 8 }"
            :wrapperCol="{ span: 4 }"
            label="检测调试后试加工零件号:"
          >
            <a-switch
              checked-children="合格"
              un-checked-children="不合格"
              :checked="model.processPass == '1'"
              @change="handle4Switch(model.processPass)"
            />
          </a-form-item>
        </a-col>
        <a-col :span="12">
          <a-form-item
            :labelCol="{ span: 8 }"
            :wrapperCol="{ span: 4 }"
            label="能否满足加工工艺要求"
          >
            <a-switch
              checked-children="能"
              un-checked-children="不能"
              @change="handle5Switch(model.meetProcessRequire)"
              :checked="model.meetProcessRequire == '1'"
            />
          </a-form-item>
        </a-col>
      </a-row>
      <a-row :gutter="24">
        <a-col
          :style="{float: 'right'}"
          :span="12"
        >
          <a-form-item
            :labelCol="{ span: 8 }"
            :wrapperCol="{ span: 4 }"
            label="使用单位技术主管"
          >
            <span v-if="this.model != null">{{ this.model.useUnitDirectorUserName }}</span>
            <span v-else>-</span>
          </a-form-item>
        </a-col>
      </a-row>
    </div>
    <div :style="{height: '115px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '50px 20px',background: '#fff',}">
      <span
        class="ant-descriptions-title"
        style="font-size: large;font-style: normal;font-size: 15px;"
      >结论</span>
    </div>
    <div :style="{height: '115px',float: 'right',width: '90%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
      <a-row :gutter="24">
        <a-col :span="24">
          <a-form-item
            :labelCol="{ span: 4 }"
            :wrapperCol="{ span: 20 }"
            label="设备判定"
          >
            <a-radio-group
              v-model="model.judgmentResult"
              @change="onChangeJudgmentResult"
            >
              <a-radio value="qualified"> åˆæ ¼ </a-radio>
              <a-radio value="limitedUse"> é™ç”¨ </a-radio>
              <a-radio value="disabled"> ç¦ç”¨ </a-radio>
            </a-radio-group>
          </a-form-item>
        </a-col>
      </a-row>
      <a-row :gutter="24">
        <a-col
          :style="{float: 'right'}"
          :span="12"
        >
          <a-form-item
            :labelCol="{ span: 8 }"
            :wrapperCol="{ span: 4 }"
            label="设备检验员签字"
          >
            <span v-if="this.model != null">{{ this.model.equipmentInspectorSignUserName }}</span>
            <span v-else>-</span>
          </a-form-item>
        </a-col>
      </a-row>
    </div>
    <div :style="{height: '115px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '50px 20px',background: '#fff',}">
      <span
        class="ant-descriptions-title"
        style="font-size: large;font-style: normal;font-size: 15px;"
      >备注</span>
    </div>
    <div :style="{height: '115px',float: 'right',width: '90%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
      <a-textarea
        allowClear
        :placeholder="'请输入备注信息'"
        v-model="model.remark "
        rows="4"
      />
      <!-- :disabled="true" -->
    </div>
    <template slot="footer">
      <a-button
        :style="{marginRight: '8px'}"
        @click="handleCancel()"
      >
        å…³é—­
      </a-button>
      <a-button
        @click="handleOk()"
        type="primary"
        :loading="confirmLoading"
        :disabled="disableSubmit || confirmLoading"
      >确定</a-button>
    </template>
  </a-modal>
</template>
<script>
import { getAction, postAction, requestPut } from '@/api/manage'
import pick from 'lodash.pick'
import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
import Tooltip from 'ant-design-vue/es/tooltip'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getFileAccessHttpUrl } from '@/api/manage';
export default {
  name: "EquipmentPrecisionCheckOrderModal",
  mixins: [JeecgListMixin],
  components: {
    JMultiSelectTag,
    Tooltip,
  },
  data() {
    return {
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
          width: 50,
        },
        {
          title: '检验项目',
          align: 'center',
          dataIndex: 'precisionParametersName',
          width: 600,
        },
        {
          title: '允差',
          align: 'center',
          dataIndex: 'tolerance'
        },
        {
          title: '实测',
          align: 'center',
          dataIndex: 'actualMeasure',
          width: 150,
          scopedSlots: { customRender: 'actualMeasure' }
        },
      ],
      title: "操作",
      visible: false,
      disableSubmit: false,
      codeDisable: true,
      dataSource: [],
      model: {},
      departs: [],
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      confirmLoading: false,
      form: this.$form.createForm(this),
      validatorRules: {
        num: {
          rules: [
            { required: true, message: '请输入保养工单编码!' },
          ]
        },
      },
      url: {
        add: "/eam/precisionInspection/precisionInspection",
        getEquipmentPrecision: "/eam/equipmentPrecisionParameters/getByEquipmentId",
        getPrecisionInspection: "/eam/precisionInspection/getPrecisionInspectionList",
        list: "/eam/dailyMaintenanceOrder/getMaintenanceCycleByStandardId",
      },
    }
  },
  methods: {
    edit(record) {
      let that = this;
      this.form.resetFields();
      // record.eachTolerance = '0'
      // record.partTolerance = '0'
      // record.processPass = '0'
      // record.meetProcessRequire = '0'
      // record.judgmentResult = ""
      this.model = Object.assign({}, record);
      this.getPrecisionInspection()
      this.getEquipmentPrecision()
      this.visible = true;
      that.$nextTick(() => {
        // that.form.setFieldsValue(pick(that.model, 'num', 'teamId', 'remark'));
      });
    },
    close() {
      this.$emit('close');
      this.visible = false;
    },
    handleCancel() {
      this.close();
    },
    handleOk() {
      const that = this;
      // è§¦å‘表单验证
      that.form.validateFields((err, values) => {
        if (!err) {
          this.$confirm({
            title: '生产设备精度检验单',
            content: '提示:请谨慎操作!',
            okText: '确认',
            cancelText: '取消',
            onOk() {
              let formData = Object.assign(that.model, values);
              formData.precisionInspectionDetailList = that.dataSource
              that.confirmLoading = true;
              postAction(that.url.add, formData).then((res) => {
                if (res.success) {
                  that.$message.success(res.message);
                  that.$emit('ok', new Date());
                } else {
                  that.$message.warning(res.message);
                }
              }).finally(() => {
                that.confirmLoading = false;
                that.close();
              })
            },
          })
        }
      })
    },
    // handleOk() {
    //   const that = this;
    //   this.form.validateFields((err, values) => {
    //     if (!err) {
    //       that.confirmLoading = true;
    //       let formData = Object.assign(this.model, values);
    //       requestPut(this.url.add, formData, { id: this.model.id }).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();
    //       })
    //     }
    //   })
    // },
    handleDelete(text, record, index) {
      this.dataSource.splice(index, 1);
    },
    getEquipmentPrecision() {
      getAction(this.url.getEquipmentPrecision, { equipmentId: this.model.equipmentId }).then((res) => {
        if (res.success) {
          this.dataSource = res.result.records
        }
      })
    },
    getPrecisionInspection() {
      getAction(this.url.getPrecisionInspection, { maintenanceOrderId: this.model.id }).then((res) => {
        if (res.success) {
          this.model = Object.assign({}, res.result[0]);
          debugger
        }
      })
    },
    handle2Switch(eachTolerance) {
      if ('0' == eachTolerance) {
        this.model.eachTolerance = '1'
      } else {
        this.model.eachTolerance = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle3Switch(partTolerance) {
      if ('0' == partTolerance) {
        this.model.partTolerance = '1'
      } else {
        this.model.partTolerance = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle4Switch(processPass) {
      if ('0' == processPass) {
        this.model.processPass = '1'
      } else {
        this.model.processPass = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle5Switch(meetProcessRequire) {
      if ('0' == meetProcessRequire) {
        this.model.meetProcessRequire = '1'
      } else {
        this.model.meetProcessRequire = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    onChangeJudgmentResult(e) {
      this.model.judgmentResult = e.target.value
    },
    handleChange(value, key, column, index) {
      let that = this;
      const temp = [...that.dataSource];
      const target = temp.filter(item => key === item.key)[index];
      if (target) {
        if ('actualMeasure' == column.dataIndex) {
          target['actualMeasure'] = value.target.value;
        }
        //显示带过来的数据
        that.dataSource = temp;
      }
    },
  },
}
</script>
<style lang="less" scoped>
/deep/ .frozenRowClass {
  color: #c9c9c9;
}
.fontweight {
  font-weight: bold;
}
.ant-btn {
  padding: 0 10px;
  margin-left: 3px;
}
.ant-form-item-control {
  line-height: 0px;
}
/** ä¸»è¡¨å•行间距 */
.ant-form .ant-form-item {
  margin-bottom: 10px;
}
/** Tab页面行间距 */
.ant-tabs-content .ant-form-item {
  margin-bottom: 0px;
}
.hightColor {
  height: 10%;
  font-weight: bold;
  font-size: 20px;
  color: #1b1e1e;
}
.frozenRowClass {
  color: #c9c9c9;
}
.fontweight {
  font-weight: bold;
}
.hight {
  color: #f5222d;
}
/deep/ .red {
  color: red;
}
.line {
  width: 1px;
  height: 300px;
  background-color: #000;
  border: none;
  float: left;
}
</style>
src/views/eam/modules/malfunctionRepair/MalfunctionRepaireModal.vue
@@ -192,7 +192,19 @@
              />
            </a-form-item>
          </a-col>
          <a-col :span="24/2">
            <a-form-item
              label="故障原因"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
            <a-input
              :disabled="disableSubmit"
                enter-button
                v-decorator="['faultReason', validatorRules.faultReason]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="24/2">
src/views/eam/modules/repairorder/RepairOrderModal.vue
@@ -239,6 +239,26 @@
              <j-date placeholder="请选择计划结束时间" v-decorator="['planEndTime', validatorRules.planEndTime ]" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
            </a-form-item>
          </a-col>
          <a-col :span="24/2" >
            <a-form-item label="故障原因" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['faultReason', validatorRules.faultReason]" placeholder="请输入设备名称" ></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24/2" >
            <a-form-item label="故障现象" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="disableSubmit"  v-decorator="['faultPhenomenon', validatorRules.faultPhenomenon]" placeholder="请输入设备型号" ></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24/2" >
            <a-form-item label="故障排除" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="disableSubmit" v-decorator="['faultRemove', validatorRules.faultRemove]" placeholder="请输入设备名称" ></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24/2" >
            <a-form-item label="预防措施" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="disableSubmit"  v-decorator="['preventiveMeasure', validatorRules.preventiveMeasure]" placeholder="请输入设备型号" ></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="故障描述" :labelCol="{span:3}" :wrapperCol="{span:21}" >
              <a-textarea rows="2" v-decorator="['faultDescription', validatorRules.faultDescription ]" placeholder="请输入故障描述" ></a-textarea>
@@ -505,7 +525,7 @@
    sendFaultReportRepairRecord(data) {
      let record = data.record;
      this.form.setFieldsValue({ reportRepairId:record.id,equipmentId: record.equipmentId,equipmentNum:record.equipmentNum,equipmentName: record.equipmentName,equipmentModel:record.equipmentModel,reportRepairNum:record.num,
        urgency:record.urgency, departId: record.useDepartId,departName:record.useDepartId_dictText });
        urgency:record.urgency, departId: record.useDepartId,departName:record.useDepartId_dictText,faultReason:record.faultReason });
    },
    onProjectMaintenanceOrder() {
      this.$refs.ProjectMaintenanceOrder.list();