设备台账
1.ABC标识变更记录功能
2.质保日期变更记录功能
3.质保到期提醒
4.ABC标识与关键设备标识联动
5.设备质保期字段添加
已添加6个文件
已修改2个文件
1221 ■■■■■ 文件已修改
src/views/eam/EquipmentList.vue 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/equipmentNew/EquipmentModal.vue 130 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/equipmentNew/EquipmentUpdateABCList.vue 169 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/equipmentNew/EquipmentUpdateWarrantyList.vue 182 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/equipmentNew/edit/ABCUpdateEditModel.vue 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/equipmentNew/edit/ABCUpdateEditTable.vue 270 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/equipmentNew/edit/WarrantyUpdateModel.vue 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/equipmentNew/edit/WarrantyUpdateTable.vue 273 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/EquipmentList.vue
@@ -241,8 +241,9 @@
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import"  v-has="'equipmentAccount:add&delete&import&Edit'">导入</a-button>
      </a-upload>
      <a-button :disabled="selectedRowKeys.length==0" @click="handleUpdateABC" type="primary" icon="font-colors" v-has="'equipmentAccount:add&delete&import&Edit'">ABC标识变更</a-button>
      <a-button :disabled="selectedRowKeys.length==0" @click="handleUpdateWarranty" type="primary" icon="calendar" v-has="'equipmentAccount:add&delete&import&Edit'">质保期变更</a-button>
    </div>
    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
@@ -260,7 +261,7 @@
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'checkbox'}"
        :customRow="clickThenSelect"
        @change="handleTableChange">
@@ -425,22 +426,30 @@
    <a-tabs defaultActiveKey="1">
      <a-tab-pane tab="工艺参数" key="1" >
        <EquipmentProcessParametersList 
        :mainId="equipmentProcessParametersMainId"
        :mainId="selectedMainId"
        :isOpen="isOpenProcess"
        />
      </a-tab-pane>
      <a-tab-pane tab="设备精度" key="2" forceRender>
        <EquipmentPrecisionParametersList 
        :isOpen="isOpenPrecision"
        :mainId="equipmentPrecisionParametersMainId" />
        :mainId="selectedMainId" />
      </a-tab-pane>
      <a-tab-pane tab="设备文档" key="3" forceRender>
        <EquipmentDocumentList :mainId="equipmentDocumentMainId" />
        <EquipmentDocumentList :mainId="selectedMainId" />
      </a-tab-pane>
      <a-tab-pane tab="ABC标识变更记录" key="4" forceRender>
        <equipment-update-ABC-list :mainId="selectedMainId" />
      </a-tab-pane>
      <a-tab-pane tab="质保期变更记录" key="5" forceRender>
        <equipment-update-warranty-list :mainId="selectedMainId" />
      </a-tab-pane>
    </a-tabs>
    <equipment-modal ref="modalForm" @ok="modalFormOk"></equipment-modal>
    <process-edit-model ref ="processEditModel"></process-edit-model>
    <precision-edit-model ref ="precisionEditModel"></precision-edit-model>
    <aBC-update-edit-model @ok="modalFormOk" :updateList="selectionRows" ref="updateABC"></aBC-update-edit-model>
    <warranty-update-model  :updateList="selectionRows"  ref="updateWarranty"></warranty-update-model>
  </a-card>
</template>
@@ -457,7 +466,13 @@
  import EquipmentResumeDrawer from './modules/equipmentNew/EquipmentResume/EquipmentResumeDrawer'
  import JSearchSelectTag from '../../components/dict/JSearchSelectTag.vue'
  import ProcessEditModel from './modules/equipmentNew/edit/ProcessEditModel.vue'
  import PrecisionEditModel from './modules/equipmentNew/edit/PrecisionEditModel.vue'
  import PrecisionEditModel from './modules/equipmentNew/edit/PrecisionEditModel'
  import EquipmentUpdateABCList from './modules/equipmentNew/EquipmentUpdateABCList.vue'
  import EquipmentUpdateWarrantyList from './modules/equipmentNew/EquipmentUpdateWarrantyList.vue'
import ABCUpdateEditModel from './modules/equipmentNew/edit/ABCUpdateEditModel.vue'
import WarrantyUpdateModel from './modules/equipmentNew/edit/WarrantyUpdateModel.vue'
 
  export default {
@@ -472,6 +487,10 @@
        JSearchSelectTag,
        ProcessEditModel,
        PrecisionEditModel,
        EquipmentUpdateABCList ,
        EquipmentUpdateWarrantyList,
        ABCUpdateEditModel,
        WarrantyUpdateModel,
    },
    data () {
      return {
@@ -726,6 +745,7 @@
          xs: { span: 24 },
          sm: { span: 16 },
        },
        mainId:'',
      }
    },
    created() {
@@ -761,16 +781,10 @@
      },
      onSelectChange(selectedRowKeys, selectionRows) {
        if(selectedRowKeys.length==1){
          this.equipmentProcessParametersMainId = selectionRows[0]['id']
          this.equipmentDocumentMainId = selectionRows[0]['id']
          this.equipmentPrecisionParametersMainId = selectionRows[0]['id']
          this.selectedMainId=selectedRowKeys[0]
          this.isOpenProcess = selectionRows[0].processParameters==1;
          this.isOpenPrecision = selectionRows[0].precisionParameters==1;
        }else{
          this.equipmentProcessParametersMainId =''
          this.equipmentDocumentMainId = ''
          this.equipmentPrecisionParametersMainId = ''
          this.selectedMainId=''
        }
        this.selectedRowKeys = selectedRowKeys;
@@ -874,6 +888,12 @@
        }
      })
    },
    handleUpdateABC(){
      this.$refs.updateABC.add();
    },
    handleUpdateWarranty(){
      this.$refs.updateWarranty.add();
    }
    }
  }
src/views/eam/modules/equipmentNew/EquipmentModal.vue
@@ -242,23 +242,6 @@
          >状态及标识</a-divider>
          <a-col :span="6">
            <a-form-model-item
              label="关键设备标识"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="specificEquipment"
            >
              <j-dict-select-tag
                allow-clear
                placeholder="请选择关键设备标识"
                :disabled="formDisabled"
                :triggerChange="true"
                dictCode="specific_equipment"
                v-model="model.specificEquipment"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="设备状态"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
@@ -289,6 +272,49 @@
                dictCode="technology_status"
                v-model="model.technologyStatus"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="资产状态"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="propertyStatus"
            >
              <j-dict-select-tag
                allow-clear
                :disabled="formDisabled"
                placeholder="请输入资产状态"
                :triggerChange="true"
                dictCode="property_status"
                v-model="model.propertyStatus"
              />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row v-if="model.propertyStatus=='warranty'">
          <a-divider
            orientation="center"
            style="font-size: large;font-style: italic;color: #66aeed;"
          >质保日期</a-divider>
          <a-col :span="6">
            <a-form-model-item
              label="质保开始日期"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="warrantyStart"
            >
            <j-date  :disabled="formDisabled" style="width: 100%;" placeholder="请选择开始日期" class="query-group-cust" v-model="model.warrantyStart"></j-date>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="质保结束日期"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="warrantyEnd"
            >
            <j-date  :disabled="formDisabled" style="width: 100%;" placeholder="请选择结束日期" class="query-group-cust" v-model="model.warrantyEnd"></j-date>
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -718,7 +744,25 @@
                placeholder="请选择ABC标识"
                :triggerChange="true"
                dictCode="ABC-standard-result"
                @change="changeNeedSpecific"
                v-model="model.equipmentImportanceId"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="6" v-if="needSpecific">
            <a-form-model-item
              label="关键设备标识"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="specificEquipment"
            >
              <j-dict-select-tag
                allow-clear
                placeholder="请选择关键设备标识"
                :disabled="formDisabled"
                :triggerChange="true"
                dictCode="specific_equipment"
                v-model="model.specificEquipment"
              />
            </a-form-model-item>
          </a-col>
@@ -798,32 +842,6 @@
                :read-only="true"
                v-model="model.processParametersTemplateId_dictText"
              />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-divider
            orientation="center"
            style="font-size: large;font-style: italic;color: #66aeed;"
          >质保日期</a-divider>
          <a-col :span="6">
            <a-form-model-item
              label="质保开始日期"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="warrantyStart"
            >
            <j-date  :disabled="formDisabled" style="width: 100%;" placeholder="请选择开始日期" class="query-group-cust" v-model="model.warrantyStart"></j-date>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="质保结束日期"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="warrantyEnd"
            >
            <j-date  :disabled="formDisabled" style="width: 100%;" placeholder="请选择结束日期" class="query-group-cust" v-model="model.warrantyEnd"></j-date>
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -943,7 +961,10 @@
        ],
        warrantyEnd:[
        { required: true, message: '请选择结束日期!' },
        ]
        ],
        propertyStatus:[
        { required: true, message: '请选择资产状态!' },
        ],
      },
      url: {
        add: "/eam/equipment/add",
@@ -951,6 +972,7 @@
        loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
      },
      treeData: [],
      needSpecific:false,
    }
  },
@@ -961,6 +983,7 @@
  },
  methods: {
    add() {
      this
      this.edit(this.modelDefault);
    },
    edit(record) {
@@ -1141,6 +1164,25 @@
      }
      this.model = Object.assign({}, this.model);
    },
    changeNeedSpecific(val){
       if(val=='A'){
          this.needSpecific=true;
       }else{
        let that = this;
        this.$confirm({
            title: '提示',
            content: '非A类设备,是否要添加关键设备标识!',
            okText: '确认',
            cancelText: '取消',
            onOk() {
              that.needSpecific = true;
            },
            onCancel(){
              that.needSpecific = false;
            }
        })
       }
    }
  },
  computed: {
src/views/eam/modules/equipmentNew/EquipmentUpdateABCList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,169 @@
<template>
  <a-card :bordered="false" :class="'cust-erp-sub-tab'">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
        </a-row>
      </a-form>
    </div>
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> å·²é€‰æ‹© <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">
        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text,record">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" :preview="record.id" 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="handleEdit(record)">编辑</a>
          <a-divider type="vertical" />
          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
            <a>删除</a>
          </a-popconfirm>
        </span>
      </a-table>
    </div>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  export default {
    name: "UpdateABC",
    mixins:[JeecgListMixin],
    components: { },
    props:{
      mainId:{
        type:String,
        default:'',
        required:false
      }
    },
    watch:{
      mainId:{
        immediate: true,
        handler(val) {
          if(!this.mainId){
            this.clearList()
          }else{
            this.queryParam['equipmentId'] = val
            this.queryParam['updateType'] = 'ABC'
            this.loadData(1);
          }
        }
      }
    },
    data () {
      return {
        description: '材料出库单管理页面',
        disableMixinCreated:true,
        // è¡¨å¤´
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'ABC标识(旧)',
            align:"center",
            dataIndex: 'oldAbcTag_dictText',
            width:300
          },
          {
            title:'ABC标识(新)',
            align:"center",
            dataIndex: 'newAbcTag_dictText',
            width:300
          },
          {
            title:'变更日期',
            align:"center",
            dataIndex: 'updateDate',
            width:300
          },
          {
            title:'变更人',
            align:"center",
            dataIndex: 'updatePerson_dictText',
            width:300
          },
          {
            title:'备注',
            align:"center",
            dataIndex: 'remark',
            width:300
          },
        ],
        url: {
          list: "/eam/equipmentUpdateInfo/list",
        },
        dictOptions:{
        }
      }
    },
    created() {
    },
    computed: {
      importExcelUrl(){
        return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`;
      }
    },
    methods: {
      clearList(){
        this.dataSource=[]
        this.selectedRowKeys=[]
        this.ipagination.current = 1
      }
    },
    mounted(){
      this.$bus.$on('loadData', (data) => {
            this.loadData();
      });
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>
src/views/eam/modules/equipmentNew/EquipmentUpdateWarrantyList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,182 @@
<template>
  <a-card :bordered="false" :class="'cust-erp-sub-tab'">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
        </a-row>
      </a-form>
    </div>
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> å·²é€‰æ‹© <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">
        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text,record">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" :preview="record.id" 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="handleEdit(record)">编辑</a>
          <a-divider type="vertical" />
          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
            <a>删除</a>
          </a-popconfirm>
        </span>
      </a-table>
    </div>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  export default {
    name: "UpdateWarranty",
    mixins:[JeecgListMixin],
    components: { },
    props:{
      mainId:{
        type:String,
        default:'',
        required:false
      }
    },
    watch:{
      mainId:{
        immediate: true,
        handler(val) {
          if(!this.mainId){
            this.clearList()
          }else{
            this.queryParam['equipmentId'] = val
            this.queryParam['updateType'] = 'warranty'
            this.loadData(1);
          }
        }
      }
    },
    data () {
      return {
        description: '材料出库单管理页面',
        disableMixinCreated:true,
        // è¡¨å¤´
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'质保开始日期(旧)',
            align:"center",
            dataIndex: 'oldStart',
            width:200
          },
          {
            title:'质保结束日期(旧)',
            align:"center",
            dataIndex: 'oldEnd',
            width:200
          },
          {
            title:'质保开始日期(新)',
            align:"center",
            dataIndex: 'newStart',
            width:200
          },
          {
            title:'质保结束日期(新)',
            align:"center",
            dataIndex: 'newEnd',
            width:200
          },
          {
            title:'变更日期',
            align:"center",
            dataIndex: 'updateDate',
            width:200
          },
          {
            title:'变更人',
            align:"center",
            dataIndex: 'updatePerson_dictText',
            width:200
          },
          {
            title:'备注',
            align:"center",
            dataIndex: 'remark',
            width:200
          },
        ],
        url: {
          list: "/eam/equipmentUpdateInfo/list",
        },
        dictOptions:{
        }
      }
    },
    created() {
    },
    computed: {
      importExcelUrl(){
        return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`;
      }
    },
    methods: {
      clearList(){
        this.dataSource=[]
        this.selectedRowKeys=[]
        this.ipagination.current = 1
      }
    },
    mounted(){
      this.$bus.$on('loadData', (data) => {
            this.loadData();
      });
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>
src/views/eam/modules/equipmentNew/edit/ABCUpdateEditModel.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,75 @@
<template>
  <j-modal
    :title="'ABC标识变更'"
    :width="1520"
    :height="600"
    :visible="visible"
    :maskClosable="true"
    :fullscreen="true"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel">
    <aBC-update-edit-table
    :updateList="updateList"
    ref="realForm"
    @ok="submitCallback"
    :disabled="disableSubmit"/>
  </j-modal>
</template>
<script>
import ABCUpdateEditTable from './ABCUpdateEditTable.vue'
  export default {
    name: 'ABCUpdateEditModel',
    components: {
        ABCUpdateEditTable
    },
    props:{
      updateList:{
        type:Array,
        default:[],
        required:false,
      }
    },
    data() {
      return {
        title:'',
        width:1500,
        visible: false,
        disableSubmit: false
      }
    },
    methods:{
      add () {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.addBefore();
        })
      },
      edit (record) {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.edit(record);
        })
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      handleOk () {
        this.$refs.realForm.handleOk();
      },
      submitCallback(){
        this.$emit('ok');
        this.$bus.$emit('loadData')
        this.visible = false;
      },
      handleCancel () {
        this.close()
      }
    }
  }
</script>
<style scoped>
</style>
src/views/eam/modules/equipmentNew/edit/ABCUpdateEditTable.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,270 @@
<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
      <!-- ä¸»è¡¨å•区域 -->
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
        </a-row>
      </a-form-model>
    </j-form-container>
      <!-- å­è¡¨å•区域 -->
    <a-tabs v-model="activeKey" @change="handleChangeTabs">
      <a-tab-pane tab="变更设备列" :key="refKeys[0]" :forceRender="true">
        <j-vxe-table
          keep-source
          :ref="refKeys[0]"
          :loading="updateABCEditTable.loading"
          :columns="updateABCEditTable.columns"
          :dataSource="updateABCEditTable.dataSource"
          :maxHeight="600"
          :disabled="formDisabled"
          :rowNumber="true"
          :rowSelection="false"
          :toolbar="false"
          bordered
          :alwaysEdit="true"
          />
      </a-tab-pane>
    </a-tabs>
  </a-spin>
</template>
<script>
  import { getAction } from '@/api/manage'
  import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
  import { duplicateCheck } from '@/api/api'
  import { JVXETypes } from '@/components/jeecg/JVxeTable'
  import { getRefPromise,VALIDATE_FAILED} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
  import { validateDuplicateValue } from '@/utils/util'
  import JFormContainer from '@/components/jeecg/JFormContainer'
  import dayjs from 'dayjs'
  export default {
    name: 'PrecisionEditTable',
    mixins: [JVxeTableModelMixin],
    components: {
      JFormContainer,
      dayjs
    },
    data() {
      return {
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        model:{
         },
        // æ–°å¢žæ—¶å­è¡¨é»˜è®¤æ·»åŠ å‡ è¡Œç©ºæ•°æ®
        addDefaultRowNum: 0,
        validatorRules: {
        },
        refKeys: ['updateABCEditTableList', ],
        tableKeys:['updateABCEditTableList', ],
        activeKey: 'updateABCEditTableList',
        updateABCEditTable: {
          loading: false,
          dataSource: [],
          columns: [
            {
              title: 'id',
              key: 'id',
               type: JVXETypes.hidden,
              disabled:true,
              align:'center',
            },
            {
              title: '统一编码',
              key: 'num',
               type: JVXETypes.normal,
              width:"200px",
              placeholder: '请输入${title}',
              disabled:true,
              align:'center',
              defaultValue:'',
            },
            {
              title: '设备名称',
              key: 'name',
               type: JVXETypes.normal,
              width:"200px",
              placeholder: '请输入${title}',
              disabled:true,
              align:'center',
              defaultValue:'',
            },
            {
              title: '设备型号',
              key: 'model',
               type: JVXETypes.normal,
              width:"200px",
              placeholder: '请输入${title}',
              disabled:true,
              align:'center',
              defaultValue:'',
            },
            {
              title: 'ABC标识(旧)',
              key: 'equipmentImportanceId',
              type: JVXETypes.normal,
              dictCode: 'ABC-standard-result',
              options:[],
              width:"200px",
              placeholder: '请选择${title}',
              align:'center',
            },
            {
              title: 'ABC标识(新)',
              key: 'newABCTag',
              type: JVXETypes.select,
              dictCode: 'ABC-standard-result',
              options:[],
              width:"200px",
              placeholder: '请选择${title}',
              align:'center',
              validateRules: [
              {
                required: true, // å¿…å¡«
                message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
              },
              {
                handler({ cellValue, row, column }, callback, target) {
                    if (cellValue==row.equipmentImportanceId) {
                        callback(false, '${title}不能与旧数据雷同') // false = æœªé€šè¿‡ï¼Œå¯ä»¥è·Ÿè‡ªå®šä¹‰æç¤º
                    } else {
                        callback(true) // true = é€šè¿‡éªŒè¯
                    }
                },
                message: '${title}默认提示'
              }
              ]
            },
            {
              title: '关键设备标识',
              key: 'specificEquipment',
              type: JVXETypes.select,
              width:"200px",
              placeholder: '请选择${title}',
              dictCode:'specific_equipment',
              align:'center',
              options:[],
              validateRules: [
              // {
              //   required: true, // å¿…å¡«
              //   message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
              // },
              { handler({ cellValue, row, column }, callback, target) {
                    if (row.newABCTag=='A'&&(cellValue==null||cellValue==''||cellValue==undefined)) {
                        callback(false, 'A类设备必须设置关键标识') // false = æœªé€šè¿‡ï¼Œå¯ä»¥è·Ÿè‡ªå®šä¹‰æç¤º
                    } else {
                        callback(true) // true = é€šè¿‡éªŒè¯
                    }
                },
                message: '${title}默认提示'
              },
              ]
            },
            {
              title: '备注',
              key: 'remark',
              type: JVXETypes.textarea,
              width:"200px",
              placeholder: '请输入${title}',
              align:'center',
              validateRules: [
              ]
            },
          ]
        },
        url: {
          // add: "/tooling/toolingMakeAccountMain/add",
          add: "/eam/equipmentUpdateInfo/updateABC",
          // queryById: "/tooling/toolingMakeAccountMain/queryById",
          updateABCEditTableList: {
            list: '/eam/equipmentPrecisionParameters/list'
          },
        }
      }
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      },
      updateList:{
        type:Array,
        default:[],
        required:false,
      }
    },
    computed: {
      formDisabled(){
        return this.disabled
      },
    },
    created () {
    },
    methods: {
      addBefore(){
        this.updateABCEditTable.dataSource = this.updateList;
      },
      getAllTable() {
        let values = this.tableKeys.map(key => getRefPromise(this, key))
        return Promise.all(values)
      },
      /** è°ƒç”¨å®Œedit()方法之后会自动调用此方法 */
      editAfter() {
        this.$nextTick(() => {
        })
        // åŠ è½½å­è¡¨æ•°æ®
        if (this.model.id) {
          let params = { equipmentId: this.model.id }
          this.requestSubTableData(this.url.updateABCEditTableList.list, params, this.updateABCEditTable)
        }
      },
      //校验所有一对一子表表单
        validateSubForm(allValues){
            return new Promise((resolve,reject)=>{
              Promise.all([
              ]).then(() => {
                resolve(allValues)
              }).catch(e => {
                if (e.error === VALIDATE_FAILED) {
                  // å¦‚果有未通过表单验证的子表,就自动跳转到它所在的tab
                  this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index]
                } else {
                  console.error(e)
                }
              })
            })
        },
      /** æ•´ç†æˆformData */
      classifyIntoFormData(allValues) {
        let main = Object.assign(this.model, allValues.formValue)
        return {
          ...main, // å±•å¼€
          updateABCEditTableList: allValues.tablesValue[0].tableData,
        }
      },
      validateError(msg){
        this.$message.error(msg)
      },
      changeDate(target){
        console.log(target)
        if(target.columnIndex==7){
             target.row.nextCheckDate=dayjs().add(target.value,'day').format('YYYY-MM-DD')
        }
      }
    }
  }
</script>
<style scoped>
</style>
src/views/eam/modules/equipmentNew/edit/WarrantyUpdateModel.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,78 @@
<template>
  <j-modal
    :title="'质保期变更'"
    :width="1515"
    :height="600"
    :visible="visible"
    :maskClosable="true"
    :fullscreen="true"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel">
    <warranty-update-table
    :updateList="updateList"
    ref="realForm"
    @ok="submitCallback"
    :disabled="disableSubmit"/>
  </j-modal>
</template>
<script>
import WarrantyUpdateTable from './WarrantyUpdateTable.vue'
  export default {
    name: 'WarrantyUpdateModel',
    components: {
      WarrantyUpdateTable
    },
    props:{
      updateList:{
        type:Array,
        default:[],
        required:false,
      }
    },
    data() {
      return {
        title:'',
        width:1500,
        visible: false,
        disableSubmit: false
      }
    },
    methods:{
      add () {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.addBefore();
        })
      },
      edit (record) {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.edit(record);
        })
      },
      close () {
        this.$emit('close');
        this.visible = false;
        this.$refs.realForm.warrantyUpdateTable.dataSource=[];
      },
      handleOk () {
        this.$refs.realForm.handleOk();
      },
      submitCallback(){
        this.$emit('ok');
        this.$bus.$emit('loadData')
        this.visible = false;
      },
      handleCancel () {
        this.close()
      }
    }
  }
</script>
<style scoped>
</style>
src/views/eam/modules/equipmentNew/edit/WarrantyUpdateTable.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,273 @@
<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
      <!-- ä¸»è¡¨å•区域 -->
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
        </a-row>
      </a-form-model>
    </j-form-container>
      <!-- å­è¡¨å•区域 -->
    <a-tabs v-model="activeKey" @change="handleChangeTabs">
      <a-tab-pane tab="变更设备列" :key="refKeys[0]" :forceRender="true">
        <j-vxe-table
          keep-source
          :ref="refKeys[0]"
          :loading="warrantyUpdateTable.loading"
          :columns="warrantyUpdateTable.columns"
          :dataSource="warrantyUpdateTable.dataSource"
          :maxHeight="600"
          :disabled="formDisabled"
          :rowNumber="true"
          :rowSelection="false"
          :toolbar="false"
          bordered
          :alwaysEdit="true"
          />
      </a-tab-pane>
    </a-tabs>
  </a-spin>
</template>
<script>
  import { getAction } from '@/api/manage'
  import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
  import { duplicateCheck } from '@/api/api'
  import { JVXETypes } from '@/components/jeecg/JVxeTable'
  import { getRefPromise,VALIDATE_FAILED} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
  import { validateDuplicateValue } from '@/utils/util'
  import JFormContainer from '@/components/jeecg/JFormContainer'
  import dayjs from 'dayjs'
  export default {
    name: 'WarrantyUpdateTable',
    mixins: [JVxeTableModelMixin],
    components: {
      JFormContainer,
      dayjs
    },
    data() {
      return {
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        model:{
         },
        // æ–°å¢žæ—¶å­è¡¨é»˜è®¤æ·»åŠ å‡ è¡Œç©ºæ•°æ®
        addDefaultRowNum: 0,
        validatorRules: {
        },
        refKeys: ['warrantyUpdateTableList', ],
        tableKeys:['warrantyUpdateTableList', ],
        activeKey: 'warrantyUpdateTableList',
        warrantyUpdateTable: {
          loading: false,
          dataSource: [],
          columns: [
          {
              title: 'id',
              key: 'id',
               type: JVXETypes.hidden,
              disabled:true,
              align:'center',
            },
            {
              title: '统一编码',
              key: 'num',
               type: JVXETypes.normal,
              width:"200px",
              placeholder: '请输入${title}',
              disabled:true,
              align:'center',
              defaultValue:'',
            },
            {
              title: '设备名称',
              key: 'name',
               type: JVXETypes.normal,
              width:"200px",
              placeholder: '请输入${title}',
              disabled:true,
              align:'center',
              defaultValue:'',
            },
            {
              title: '设备型号',
              key: 'model',
               type: JVXETypes.normal,
              width:"200px",
              placeholder: '请输入${title}',
              disabled:true,
              align:'center',
              defaultValue:'',
            },
            {
              title: '质保开始日期(旧)',
              key: 'warrantyStart',
              type: JVXETypes.normal,
              width:"200px",
              placeholder: '请输入${title}',
              align:'center',
            },
            {
              title: '质保开始日期(新)',
              key: 'newStart',
              type: JVXETypes.date,
              width:"200px",
              placeholder: '请输入${title}',
              align:'center',
              defaultValue:365,
              validateRules: [
              {
                required: true, // å¿…å¡«
                message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
              },
              { handler({ cellValue, row, column }, callback, target) {
                    if (cellValue==row.warrantyStart) {
                        callback(false, '${title}不能与旧数据雷同') // false = æœªé€šè¿‡ï¼Œå¯ä»¥è·Ÿè‡ªå®šä¹‰æç¤º
                    } else {
                        callback(true) // true = é€šè¿‡éªŒè¯
                    }
                },
                message: '${title}默认提示'
              },
              ]
            },
            {
              title: '质保结束日期(旧)',
              key: 'warrantyEnd',
              type: JVXETypes.normal,
              width:"200px",
              placeholder: '请输入${title}',
              align:'center',
            },
            {
              title: '质保结束日期(旧)',
              key: 'newEnd',
              type: JVXETypes.date,
              width:"200px",
              placeholder: '请输入${title}',
              align:'center',
              defaultValue:365,
              validateRules: [
              {
                required: true, // å¿…å¡«
                message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
              },
              { handler({ cellValue, row, column }, callback, target) {
                    if (cellValue==row.warrantyEnd) {
                        callback(false, '${title}不能跟旧数据雷同') // false = æœªé€šè¿‡ï¼Œå¯ä»¥è·Ÿè‡ªå®šä¹‰æç¤º
                    } else {
                        callback(true) // true = é€šè¿‡éªŒè¯
                    }
                },
                message: '${title}默认提示'
              },
              ]
            },
            {
              title: '备注',
              key: 'remark',
              type: JVXETypes.textarea,
              width:"200px",
              placeholder: '请输入${title}',
              align:'center',
              validateRules: [
              ]
            },
          ]
        },
        url: {
          // add: "/tooling/toolingMakeAccountMain/add",
          add: "/eam/equipmentUpdateInfo/updateWarranty",
          // queryById: "/tooling/toolingMakeAccountMain/queryById",
          warrantyUpdateTableList: {
            list: '/eam/equipmentPrecisionParameters/list'
          },
        }
      }
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      },
      updateList:{
        type:Array,
        default:[],
        required:false,
      }
    },
    computed: {
      formDisabled(){
        return this.disabled
      },
    },
    created () {
    },
    methods: {
      addBefore(){
        this.warrantyUpdateTable.dataSource = this.updateList
      },
      getAllTable() {
        let values = this.tableKeys.map(key => getRefPromise(this, key))
        return Promise.all(values)
      },
      /** è°ƒç”¨å®Œedit()方法之后会自动调用此方法 */
      editAfter() {
        this.$nextTick(() => {
        })
        // åŠ è½½å­è¡¨æ•°æ®
        if (this.model.id) {
          let params = { equipmentId: this.model.id }
          this.requestSubTableData(this.url.warrantyUpdateTableList.list, params, this.warrantyUpdateTable)
        }
      },
      //校验所有一对一子表表单
        validateSubForm(allValues){
            return new Promise((resolve,reject)=>{
              Promise.all([
              ]).then(() => {
                resolve(allValues)
              }).catch(e => {
                if (e.error === VALIDATE_FAILED) {
                  // å¦‚果有未通过表单验证的子表,就自动跳转到它所在的tab
                  this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index]
                } else {
                  console.error(e)
                }
              })
            })
        },
      /** æ•´ç†æˆformData */
      classifyIntoFormData(allValues) {
        let main = Object.assign(this.model, allValues.formValue)
        return {
          ...main, // å±•å¼€
          warrantyUpdateTableList: allValues.tablesValue[0].tableData,
        }
      },
      validateError(msg){
        this.$message.error(msg)
      },
      changeDate(target){
        console.log(target)
        if(target.columnIndex==7){
             target.row.nextCheckDate=dayjs().add(target.value,'day').format('YYYY-MM-DD')
        }
      }
    }
  }
</script>
<style scoped>
</style>