hyingbo
14 小时以前 e0e111d15a3f3995799b8b480c162c619ec897aa
大修项修现场问题处理
已修改3个文件
134 ■■■■ 文件已修改
src/views/eam/repair/EamMajorPartialRepairList.vue 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/repair/modules/EamMajorPartialRepairDetailModal.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/repair/modules/EamMajorPartialRepairForm.vue 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/repair/EamMajorPartialRepairList.vue
@@ -14,39 +14,40 @@
              <a-input placeholder="请输入项目名称" v-model="queryParam.repairName"></a-input>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="维修状态">
                <j-dict-select-tag placeholder="请选择维修状态" v-model="queryParam.repairStatus" dictCode="major_partial_repair_status"/>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="维修类型">
                <a-select v-model="queryParam.repairType" placeholder="请选择维修类型">
                  <a-select-option value="大修">大修</a-select-option>
                  <a-select-option value="项修">项修</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="计划开始日期">
                <a-range-picker
                  v-model="planDateRange"
                  @change="selectDateChange"
                  format="YYYY-MM-DD"
                  value-format="YYYY-MM-DD"
                />
              </a-form-item>
            </a-col>
          </template>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="维修状态">
              <j-dict-select-tag placeholder="请选择维修状态" v-model="queryParam.repairStatus" dictCode="major_partial_repair_status"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="维修类型">
              <a-select v-model="queryParam.repairType" placeholder="请选择维修类型">
                <a-select-option value="大修">大修</a-select-option>
                <a-select-option value="项修">项修</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="计划开始日期">
              <a-range-picker
                v-model="planDateRange"
                @change="selectDateChange"
                format="YYYY-MM-DD"
                value-format="YYYY-MM-DD"
              />
            </a-form-item>
          </a-col>
<!--          <template v-if="toggleSearchStatus">-->
<!--            -->
<!--          </template>-->
          <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>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
<!--              <a @click="handleToggleSearch" style="margin-left: 8px">-->
<!--                {{ toggleSearchStatus ? '收起' : '展开' }}-->
<!--                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>-->
<!--              </a>-->
            </span>
          </a-col>
        </a-row>
src/views/eam/repair/modules/EamMajorPartialRepairDetailModal.vue
@@ -91,6 +91,11 @@
  },
  methods: {
    open(record) {
      // 先清空原有数据
      this.detail.dataSource = []
      if (this.$refs.editableDetailTable) {
        this.$refs.editableDetailTable.clearData()
      }
      this.visible = true
      getAction(this.url.queryDetailList, { repairId: record.id }).then((res) => {
        if (res.success) {
src/views/eam/repair/modules/EamMajorPartialRepairForm.vue
@@ -28,18 +28,19 @@
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="申请人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicant">
              <j-search-select-tag  placeholder="请选择申请人" v-model="model.applicant" dict="sys_user,realname, username, del_flag=0 and status=1"/>
              <j-search-select-tag disabled placeholder="请选择申请人" v-model="model.applicant" dict="sys_user,realname, username, del_flag=0 and status=1"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="申请车间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicantProduction">
              <a-tree-select v-model="model.applicantProduction"
                             style="width: 100%"
                             :tree-data="treeData"
                             :tree-data="treeDataAlias"
                             :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                             placeholder="请选择申请车间"
                             allow-clear
                             tree-default-expand-all
                             @change="handleWorkShopChange"
              >
              </a-tree-select>
            </a-form-model-item>
@@ -74,7 +75,7 @@
              <a-input v-model="model.applicantReason" placeholder="请输入申请原因"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
          <a-col :span="8" v-if="disabled">
            <a-form-model-item label="责任人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="responsiblePerson">
              <j-search-select-tag  placeholder="请选择责任人" v-model="model.responsiblePerson" dict="sys_user,realname, username, del_flag=0 and status=1"/>
            </a-form-model-item>
@@ -120,6 +121,8 @@
import { getAction, httpAction } from '@/api/manage'
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
import { JVXETypes } from '@/components/jeecg/JVxeTable'
import Vue from 'vue'
import { USER_INFO } from '@/store/mutation-types'
export default {
    name: 'EamMajorPartialRepairForm',
@@ -137,6 +140,7 @@
    data () {
      return {
        model: {},
        treeDataAlias: [],
        labelCol: {
          xs: { span: 24 },
          sm: { span: 7 },
@@ -154,7 +158,7 @@
          planStartDate: { required: true, message: '请选择计划开始日期!' },
          planEndDate: { required: true, message: '请选择计划结束日期!' },
          applicantReason: { required: true, message: '请输入申请原因!' },
          responsiblePerson: { required: true, message: '请输入责任人!' },
          // responsiblePerson: { required: true, message: '请输入责任人!' },
          faultDescription: { required: true, message: '请输入故障描述!' }
        },
        treeData: [],
@@ -169,6 +173,7 @@
          queryById: "/eam/eamMajorPartialRepair/queryById",
          queryDetailList: "/eam/eamMajorPartialRepairDetail/list",
          queryEquipmentList: "/eam/equipment/asyncLoadEquipment",
          queryEquipmentByProductionList: "/eam/equipment/asyncLoadEquipmentByProduction",
          loadWorkShopOptions:'/mdc/mdcProduction/loadProductionTreeOptions'
        }
      }
@@ -233,16 +238,71 @@
        getAction(this.url.loadWorkShopOptions).then(res => {
          if (res.success) {
            this.treeData = [...res.result]
            this.treeDataAlias = this.deepCopyAndModify(res.result)
          }else {
            that.$message.warning(res.message)
          }
        })
      },
      handleWorkShopChange(productionId) {
        this.detail.dataSource = []
        if (productionId) {
          this.getEquipmentList(productionId);
        } else {
          this.equipmentOptions = [];
        }
      },
      getEquipmentList(productionId) {
        //加载车间选择树
        getAction(this.url.queryEquipmentByProductionList, {productionId: productionId}).then((res) => {
          if (res.success) {
            this.equipmentOptions = res.result.map(item => {
              return {
                label: item.text,
                value: item.value
              }
            })
          }
        })
      },
      deepCopyAndModify(arr) {
        // 如果当前元素不是数组或对象,直接返回
        if (!Array.isArray(arr) && typeof arr !== 'object' || arr === null || arr.length === 0) {
          return arr;
        }
        // 如果是数组,创建一个新数组并递归处理每个元素
        if (Array.isArray(arr)) {
          const newArray = [];
          for (let i = 0; i < arr.length; i++) {
            newArray.push(this.deepCopyAndModify(arr[i]));
          }
          return newArray;
        }
        // 如果是对象,创建一个新对象并递归处理每个属性
        const newObj = {};
        for (const key in arr) {
          if (arr.hasOwnProperty(key)) {
            if(key === 'selectable') {
              newObj[key] = true;
            } else if(key === 'children') {
              newObj[key] = this.deepCopyAndModify(arr[key]);
            }else {
              newObj[key] = arr[key];
            }
          }
        }
        return newObj;
      },
      add () {
        this.edit(this.modelDefault)
      },
      edit (record) {
        this.model = Object.assign({}, record);
        this.model = Object.assign({
          applicant: Vue.ls.get(USER_INFO).username
        }, record);
        console.log("this.model", this.model)
        this.visible = true
        if (this.model.id) {
          getAction(this.url.queryDetailList, { repairId: this.model.id }).then((res) => {