已添加3个文件
已修改8个文件
1154 ■■■■ 文件已修改
src/views/eam/base/EamMaintenanceStandardList.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/base/modules/EamMaintenanceStandardModal.vue 372 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/equipment/EamEquipmentLedger.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/equipment/modules/EamEquipmentModal.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/maintenance/EamInspectionOrderList.vue 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/maintenance/modules/EamInspectionOrderModal.vue 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/FlowTodo.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue 232 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/SysParamsList.vue 214 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/SysParamsModal.vue 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/SysParamsModal__Style#Drawer.vue 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/base/EamMaintenanceStandardList.vue
@@ -113,6 +113,14 @@
                  <a @click.stop="event=>event.stopPropagation()">删除</a>
              </a-popconfirm>
          </template>
          <template v-if="record.standardStatus != 'WAIT_SUBMIT'">
            <a-divider type="vertical"/>
          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
            <a @click.stop="event=>event.stopPropagation()">删除</a>
          </a-popconfirm>
          </template>
        </span>
      </a-table>
src/views/eam/base/modules/EamMaintenanceStandardModal.vue
@@ -1,13 +1,6 @@
<template>
  <j-modal
    :title="title"
    :width="1200"
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
  <j-modal :title="title" :width="1200" :visible="visible" :confirmLoading="confirmLoading" switchFullscreen
           @ok="handleOk" @cancel="handleCancel" cancelText="关闭">
    <a-spin :spinning="spinning">
      <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
        <a-row :gutter="24">
@@ -44,6 +37,7 @@
          <a-col :span="8">
            <a-form-model-item prop="maintenancePeriod" label="保养周期">
              <a-input-number v-model="model.maintenancePeriod" placeholder="请输入保养周期" :min="1" :precision="0"
                              :disabled="model.maintenanceCategory=='POINT_INSPECTION'||model.maintenanceCategory=='SECOND_MAINTENANCE'"
                              style="width: 100%"/>
            </a-form-model-item>
          </a-col>
@@ -70,33 +64,44 @@
        </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;">
            <template v-slot:itemPart="props">
              <a-textarea v-model="props.row.itemPart" allowClear @blur="$refs.editableDetailTable.validateTable()"
                          :placeholder="!Boolean(model.maintenanceCategory)?'请选择保养分类':'请输入部位'" :rows="1"
                          autoSize :disabled="!Boolean(model.maintenanceCategory)"/>
          <a-tabs :active-key="activeTabKey" v-if="model.maintenanceCategory" @change="handleTabChange">
            <!--点检-->
            <template v-if="model.maintenanceCategory=='POINT_INSPECTION'">
              <a-tab-pane tab="日点检" key="1" forceRender>
                <j-vxe-table ref="editableDetailTable1" rowNumber rowSelection bordered alwaysEdit toolbar
                             :toolbarConfig="detail.toolbarConfig" keep-source :height="300"
                             :dataSource="detail.dayInspectionList" :columns="detail.inspectionColumns"/>
              </a-tab-pane>
              <a-tab-pane tab="周点检" key="2" forceRender>
                <j-vxe-table ref="editableDetailTable2" rowNumber rowSelection bordered alwaysEdit toolbar
                             :toolbarConfig="detail.toolbarConfig" keep-source :height="300"
                             :dataSource="detail.weekInspectionList" :columns="detail.inspectionColumns"/>
              </a-tab-pane>
            </template>
            <template v-slot:itemCategory="props">
              <j-dict-select-tag v-model="props.row.itemCategory" :dict-code="encodedDictCode"
                                 @change="$refs.editableDetailTable.validateTable()"
                                 :placeholder="!Boolean(model.maintenanceCategory)?'请选择保养分类':'请选择项保养分类'"
                                 :disabled="!Boolean(model.maintenanceCategory)"/>
            <!--二保-->
            <template v-if="model.maintenanceCategory=='SECOND_MAINTENANCE'">
              <a-tab-pane tab="操作工" key="1" forceRender>
                <j-vxe-table ref="editableDetailTable1" rowNumber rowSelection bordered alwaysEdit toolbar
                             :toolbarConfig="detail.toolbarConfig" keep-source :height="300"
                             :dataSource="detail.operatorMaintenanceList" :columns="detail.secondMaintenanceColumns"/>
              </a-tab-pane>
              <a-tab-pane tab="维修工" key="2" forceRender>
                <j-vxe-table ref="editableDetailTable2" rowNumber rowSelection bordered alwaysEdit toolbar
                             :toolbarConfig="detail.toolbarConfig" keep-source :height="300"
                             :dataSource="detail.repairerMaintenanceList" :columns="detail.secondMaintenanceColumns"/>
              </a-tab-pane>
            </template>
          </j-vxe-table>
            <!--三保-->
            <template v-if="model.maintenanceCategory=='THIRD_MAINTENANCE'">
              <a-tab-pane tab="三保" key="1">
                <j-vxe-table ref="editableDetailTable1" rowNumber rowSelection bordered alwaysEdit toolbar
                             :toolbarConfig="detail.toolbarConfig" keep-source :height="300"
                             :dataSource="detail.thirdMaintenanceList" :columns="detail.thirdMaintenanceColumns"/>
              </a-tab-pane>
            </template>
          </a-tabs>
        </a-row>
      </a-form-model>
    </a-spin>
@@ -132,6 +137,7 @@
        },
        confirmLoading: false,
        spinning: false,
        activeTabKey: '1',
        validatorRules: {
          standardName: [
            { required: true, message: '请输入规范名称', trigger: 'change' }
@@ -156,9 +162,12 @@
          upgrade: '/eam/maintenanceStandard/upgrade'
        },
        detail: {
          loading: false,
          dataSource: [],
          columns: [
          dayInspectionList: [],
          weekInspectionList: [],
          operatorMaintenanceList: [],
          repairerMaintenanceList: [],
          thirdMaintenanceList: [],
          inspectionColumns: [
            {
              title: 'ID',
              key: 'id',
@@ -176,27 +185,7 @@
              align: 'center',
              placeholder: '请输入项目序号',
              width: 150,
              validateRules: [
                { required: true, message: '请输入项目序号' },
                { unique: true, message: '项目序号不能重复' }
              ]
            },
            {
              title: '部位',
              key: 'itemPart',
              type: JVXETypes.slot,
              slotName: 'itemPart',
              placeholder: '请输入部位',
              align: 'center',
              validateRules: [{ handler: this.itemPartValidate }]
            },
            {
              title: '保养项分类',
              key: 'itemCategory',
              type: JVXETypes.slot,
              slotName: 'itemCategory',
              align: 'center',
              validateRules: [{ handler: this.itemCategoryValidate }]
              validateRules: [{ required: true, message: '请输入${title}' }]
            },
            {
              title: '保养项目',
@@ -204,22 +193,10 @@
              placeholder: '请输入保养项目',
              type: JVXETypes.textarea,
              align: 'center',
              validateRules: [
                { required: true, message: '请输入保养项目' }
              ]
            },
            {
              title: '保养规范或要求',
              key: 'itemDemand',
              placeholder: '请输入保养规范或要求',
              type: JVXETypes.textarea,
              align: 'center',
              validateRules: [
                { required: true, message: '请输入保养规范或要求' }
              ]
              validateRules: [{ required: true, message: '请输入${title}' }]
            }
          ],
          defaultColumns: [
          secondMaintenanceColumns: [
            {
              title: 'ID',
              key: 'id',
@@ -237,27 +214,7 @@
              align: 'center',
              placeholder: '请输入项目序号',
              width: 150,
              validateRules: [
                { required: true, message: '请输入项目序号' },
                { unique: true, message: '项目序号不能重复' }
              ]
            },
            {
              title: '部位',
              key: 'itemPart',
              type: JVXETypes.slot,
              slotName: 'itemPart',
              placeholder: '请输入部位',
              align: 'center',
              validateRules: [{ handler: this.itemPartValidate }]
            },
            {
              title: '保养项分类',
              key: 'itemCategory',
              type: JVXETypes.slot,
              slotName: 'itemCategory',
              align: 'center',
              validateRules: [{ handler: this.itemCategoryValidate }]
              validateRules: [{ required: true, message: '请输入${title}' }]
            },
            {
              title: '保养项目',
@@ -265,9 +222,7 @@
              placeholder: '请输入保养项目',
              type: JVXETypes.textarea,
              align: 'center',
              validateRules: [
                { required: true, message: '请输入保养项目' }
              ]
              validateRules: [{ required: true, message: '请输入${title}' }]
            },
            {
              title: '保养规范或要求',
@@ -275,9 +230,43 @@
              placeholder: '请输入保养规范或要求',
              type: JVXETypes.textarea,
              align: 'center',
              validateRules: [
                { required: true, message: '请输入保养规范或要求' }
              ]
              validateRules: [{ required: true, message: '请输入${title}' }]
            }
          ],
          thirdMaintenanceColumns: [
            {
              title: 'ID',
              key: 'id',
              type: JVXETypes.hidden
            },
            {
              title: 'standardId',
              key: 'standardId',
              type: JVXETypes.hidden
            },
            {
              title: '保养部位',
              key: 'itemPart',
              type: JVXETypes.textarea,
              slotName: 'itemPart',
              align: 'center',
              validateRules: [{ required: true, message: '请输入${title}' }]
            },
            {
              title: '保养内容',
              key: 'itemName',
              placeholder: '请输入${title}',
              type: JVXETypes.textarea,
              align: 'center',
              validateRules: [{ required: true, message: '请输入${title}' }]
            },
            {
              title: '验收标准',
              key: 'itemDemand',
              placeholder: '请输入${title}',
              type: JVXETypes.textarea,
              align: 'center',
              validateRules: [{ required: true, message: '请输入${title}' }]
            }
          ],
          toolbarConfig: {
@@ -289,36 +278,14 @@
        }
      }
    },
    watch: {
      'model.maintenanceCategory': {
        handler(val) {
          if (val) {
            if (val != 'THIRD_MAINTENANCE') this.detail.columns = [...this.detail.defaultColumns.filter(item => item.key != 'itemPart')]
            else this.detail.columns = [...this.detail.defaultColumns.filter(item => item.key != 'itemCategory')]
          }
          else this.detail.columns = [...this.detail.defaultColumns]
        }
      }
    },
    computed: {
      encodedDictCode() {
        let suffix
        if (!Boolean(this.model.maintenanceCategory) || this.model.maintenanceCategory === 'THIRD_MAINTENANCE') return
        else suffix = this.model.maintenanceCategory.split('_')[1]
        const dictCode = `sys_dict_item,item_text,item_value,item_value like '%${suffix}' and dict_id='1940598438685134850'`
        return encodeURIComponent(dictCode)
      }
    },
    methods: {
      // ä¸»é¡µé¢ç‚¹å‡»æ–°å¢žåŽè§¦å‘
      add() {
        this.resetData()
        this.model = {}
        this.visible = true
        this.editable = true
        this.upgradeFlag = false
        this.detail.dataSource = []
      },
      /**
@@ -326,11 +293,11 @@
       * @param record ä¸»é¡µé¢åˆ—表行记录
       */
      edit(record) {
        this.resetData()
        this.model = Object.assign({}, record)
        this.visible = true
        this.editable = false
        this.upgradeFlag = false
        this.detail.dataSource = []
        this.loadDetail(record.id)
      },
@@ -339,12 +306,39 @@
       * @param record ä¸»é¡µé¢åˆ—表行记录
       */
      upgrade(record) {
        this.resetData()
        this.model = Object.assign({}, record)
        this.visible = true
        this.editable = false
        this.upgradeFlag = true
        this.detail.dataSource = []
        this.loadDetail(record.id)
      },
      //加载详情数据
      loadDetail(standardId) {
        this.spinning = true
        getAction(this.url.detail, { standardId })
          .then(res => {
            if (res.success) {
              switch (this.model.maintenanceCategory) {
                case 'POINT_INSPECTION':
                  this.detail.dayInspectionList = res.result.filter(item => item.itemCategory == 'DAY_INSPECTION')
                  this.detail.weekInspectionList = res.result.filter(item => item.itemCategory == 'WEEK_INSPECTION')
                  break
                case 'SECOND_MAINTENANCE':
                  this.detail.operatorMaintenanceList = res.result.filter(item => item.itemCategory == 'OPERATOR_MAINTENANCE')
                  this.detail.repairerMaintenanceList = res.result.filter(item => item.itemCategory == 'REPAIRER_MAINTENANCE')
                  break
                case 'THIRD_MAINTENANCE':
                  this.detail.thirdMaintenanceList = res.result.filter(item => !Boolean(item.itemCategory))
                  break
                default:
              }
            }
          })
          .finally(() => {
            this.spinning = false
          })
      },
      /**
@@ -352,71 +346,93 @@
       * @param value ä¿å…»åˆ†ç±»å€¼
       */
      handleMaintenanceCategoryChange(value) {
        delete this.model.maintenancePeriod
        switch (value) {
          case 'THIRD_MAINTENANCE':
            this.model.periodUnit = 'å¹´'
            if (this.activeTabKey != '1') this.activeTabKey = '1'
            break
          case 'SECOND_MAINTENANCE':
            this.model.periodUnit = '月'
            this.model.maintenancePeriod = 6
            break
          case 'POINT_INSPECTION':
            this.model.periodUnit = '天'
            this.model.maintenancePeriod = 1
            break
          default:
            delete this.model.periodUnit
        }
        const tableData = this.$refs.editableDetailTable.getTableData()
        tableData.forEach(item => {
          if (value !== 'THIRD_MAINTENANCE') delete item.itemPart
          delete item.itemCategory
        })
        this.detail.dataSource = [...tableData]
        this.$refs.editableDetailTable.validateTable()
        if (this.model.maintenancePeriod) this.$refs.form.clearValidate('maintenancePeriod')
      },
      /**
       * ä¿å…»éƒ¨ä½æ ¡éªŒ
       * @param cellValue è¾“入值
       * @param callback å›žè°ƒå‡½æ•°
       */
      itemPartValidate({ cellValue }, callback) {
        if (this.model.maintenanceCategory === 'THIRD_MAINTENANCE') {
          if (cellValue) callback(true)
          else callback(false, '请选择${title}')
        } else {
          callback(true)
        }
      },
      /**
       * ä¿å…»é¡¹åˆ†ç±»æ ¡éªŒ
       * @param cellValue è¾“入值
       * @param callback å›žè°ƒå‡½æ•°
       */
      itemCategoryValidate({ cellValue }, callback) {
        if (this.model.maintenanceCategory === 'THIRD_MAINTENANCE') {
          callback(true)
        } else {
          if (cellValue) callback(true)
          else callback(false, '请选择${title}')
        }
      async handleTabChange(tabKey) {
        let errMap = await this.$refs['editableDetailTable' + this.activeTabKey].validateTable()
        if (errMap) return
        this.activeTabKey = tabKey
      },
      // æäº¤äº‹ä»¶
      async handleOk() {
        // ä¿å…»åˆ†ç±»ä¸ºç©ºæ—¶ä¸æ ¡éªŒæ˜Žç»†
        if (this.model.maintenanceCategory) {
          // æ ¡éªŒå½“下tab下的表格是否为空
          let tableData = this.$refs['editableDetailTable' + this.activeTabKey].getTableData()
          if (tableData.length == 0) {
            this.$notification.warning({
              message: '消息',
              description: '当前保养明细不能为空'
            })
            return
          }
          // æ ¡éªŒå½“前tab下的表格校验规则
          let errMap = await this.$refs['editableDetailTable' + this.activeTabKey].validateTable()
          if (errMap) return false
          // æ ¡éªŒå¦ä¸€tab保养明细表格是否为空(三保无需)
          if (this.model.maintenanceCategory != 'THIRD_MAINTENANCE') {
            if (this.activeTabKey == '1') tableData = this.$refs.editableDetailTable2.getTableData()
            else tableData = this.$refs.editableDetailTable1.getTableData()
            if (tableData.length == 0) {
              this.activeTabKey = this.activeTabKey == '1' ? '2' : '1'
              this.$notification.warning({
                message: '消息',
                description: '当前保养明细不能为空'
              })
              return
            }
          }
        }
        const that = this
        let errMap = await that.$refs.editableDetailTable.validateTable()
        if (errMap) return false
        // è§¦å‘表单验证
        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]
            let tableData1 = that.$refs.editableDetailTable1.getTableData()
            let tableData2 = []
            let currentTabItemMaintenanceList = []
            if (this.model.maintenanceCategory != 'THIRD_MAINTENANCE') {
              tableData2 = that.$refs.editableDetailTable2.getTableData()
              if (this.model.maintenanceCategory == 'POINT_INSPECTION') currentTabItemMaintenanceList = ['DAY_INSPECTION', 'WEEK_INSPECTION']
              else currentTabItemMaintenanceList = ['OPERATOR_MAINTENANCE', 'REPAIRER_MAINTENANCE']
            }
            if (currentTabItemMaintenanceList.length != 0) {
              tableData1 = tableData1.map(item => {
                return {
                  ...item,
                  itemCategory: currentTabItemMaintenanceList[0]
                }
              })
              tableData2 = tableData2.map(item => {
                return {
                  ...item,
                  itemCategory: currentTabItemMaintenanceList[1]
                }
              })
            }
            that.model.tableDetailList = [...tableData1, ...tableData2]
            that.confirmLoading = that.spinning = true
            let httpUrl = ''
            let method = ''
@@ -456,6 +472,15 @@
        })
      },
      resetData() {
        this.activeTabKey = '1'
        this.detail.dayInspectionList = []
        this.detail.weekInspectionList = []
        this.detail.operatorMaintenanceList = []
        this.detail.repairerMaintenanceList = []
        this.detail.thirdMaintenanceList = []
      },
      handleCancel() {
        this.close()
      },
@@ -464,23 +489,6 @@
        this.$emit('close')
        this.visible = false
        this.$refs.form.clearValidate()
      },
      //加载详情数据
      loadDetail(standardId) {
        this.spinning = true
        this.detail.dataSource = []
        if (standardId) {
          getAction(this.url.detail, { standardId })
            .then(res => {
              if (res.success) {
                this.detail.dataSource = [...res.result]
              }
            })
            .finally(() => {
              this.spinning = false
            })
        }
      }
    }
src/views/eam/equipment/EamEquipmentLedger.vue
@@ -96,7 +96,7 @@
               :pagination="ipagination" :loading="loading" :scroll="{ x: 'max-content' }"
               :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange">
        <!--统一编码-->
        <template slot="equipmentCode" slot-scope="text">
        <template slot="equipmentCode" slot-scope="text,record">
          <a href="#" @click="handleDetail(record)" style="display: inline-block;height: 100%">{{text}}</a>
        </template>
src/views/eam/equipment/modules/EamEquipmentModal.vue
@@ -352,9 +352,6 @@
        }
      }
    },
    created() {
      this.loadAllProductionTree()
    },
    methods: {
      add() {
        this.editable = true
src/views/eam/maintenance/EamInspectionOrderList.vue
@@ -282,21 +282,24 @@
      },
      handleInspection(id) {
        var that = this
        getAction(that.url.receiveInspectionOrder, { id }).then((res) => {
          if (res.success) {
            that.$notification.success({
              message: '消息',
              description: res.message
            })
            that.loadData()
          } else {
            // that.$message.warning(res.message);
            that.$notification.warning({
              message: '消息',
              description: res.message
            })
          }
        })
        this.loading = true
        getAction(that.url.receiveInspectionOrder, { id })
          .then((res) => {
            if (res.success) {
              that.$notification.success({
                message: '消息',
                description: res.message
              })
              that.loadData()
            } else {
              // that.$message.warning(res.message);
              that.$notification.warning({
                message: '消息',
                description: res.message
              })
              this.loading = false
            }
          })
      },
      handleOrReceive(id) {
        if (!this.url.cancelInspectionOrder) {
@@ -400,7 +403,7 @@
      onInspectionDateChange: function(value, dateString) {
        this.queryParam.inspectionDateBegin = dateString[0]
        this.queryParam.inspectionDateEnd = dateString[1]
      },
      }
    }
  }
</script>
src/views/eam/maintenance/modules/EamInspectionOrderModal.vue
@@ -131,21 +131,18 @@
              type: JVXETypes.normal,
              width: 100,
              align: 'center',
              disabled: true
            },
            {
              title: '保养项',
              key: 'itemName',
              type: JVXETypes.textarea,
              type: JVXETypes.normal,
              align: 'center',
              disabled: true
            },
            {
              title: '保养规范或要求',
              key: 'itemDemand',
              type: JVXETypes.textarea,
              type: JVXETypes.normal,
              align: 'center',
              disabled: true
            }
          ],
          weekInspectionColumns: [],
@@ -156,40 +153,38 @@
              type: JVXETypes.normal,
              width: 60,
              align: 'center',
              disabled: true
            },
            {
              title: '保养项',
              key: 'itemName',
              type: JVXETypes.textarea,
              type: JVXETypes.normal,
              align: 'center',
              disabled: true
            },
            {
              title: '保养要求',
              key: 'itemDemand',
              type: JVXETypes.textarea,
              type: JVXETypes.normal,
              align: 'center',
              disabled: true
            },
            {
              title: '点检结果',
              key: 'inspectionResult',
              type: JVXETypes.textarea,
              type: JVXETypes.select,
              dictCode: 'inspection_project_result',
              align: 'center',
              disabled: true
            },
            {
              title: '异常描述',
              key: 'exceptionDescription',
              type: JVXETypes.textarea,
              type: JVXETypes.normal,
              align: 'center',
              disabled: true
            },
            {
              title: '异常是否报修',
              key: 'reportFlag',
              type: JVXETypes.textarea,
              type: JVXETypes.select,
              ditCode: 'yn',
              align: 'center',
              disabled: true
            }
@@ -302,8 +297,8 @@
        })
          .then(res => {
            if (res.success) {
              if (res.result.length > 0) {
                this.detail.weekInspectionList = res.result
              if (res.result.list.length > 0) {
                this.detail.weekInspectionList = res.result.list
                this.detail.weekInspectionColumns = this.detail.weekInspectionOrderColumns
              }
            }
src/views/flowable/workflow/FlowTodo.vue
@@ -91,7 +91,8 @@
    <maintenance-standard-approval-modal ref="maintenanceStandardApprovalModal" @modalFormOk="modalFormOk"
                                         :selectShenpiData="selectedRowData"/>
    <inspection-order-handle ref="modalFormInspectionOrder" :selectShenpiData="selectedRowData"/>
    <inspection-order-handle ref="modalFormInspectionOrder" :selectShenpiData="selectedRowData"
                             @modalFormOk="modalFormOk"/>
  </a-card>
</template>
@@ -278,7 +279,7 @@
      handInspectionOrder(record) {
        console.log('record----->', record)
        this.selectInspectionOrderData = Object.assign({}, record)
        this.selectedRowData = Object.assign({}, record)
        this.$refs.modalFormInspectionOrder.visible = true
        this.$refs.modalFormInspectionOrder.title = record.name
        this.$refs.modalFormInspectionOrder.getAllApproveData(record)
src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue
@@ -1,6 +1,6 @@
<template>
  <j-modal :title="title" :width="1200" :visible="visible"
           :okButtonProps="{ class:{'jee-hidden': disableSubmit||!hasInspectionDateArrived} }" @ok="submitForm"
           :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" @ok="submitForm"
           @cancel="handleCancel" :mask-closable="false" :confirmLoading="confirmLoading" fullscreen>
    <a-spin :spinning="spinning">
      <a-form-model ref='form' :model='tableRowRecord' :labelCol="labelCol" :wrapperCol="wrapperCol"
@@ -76,15 +76,15 @@
            </a-tabs>
          </a-col>
          <a-col :span="disableSubmit||tableRowRecord.inspectionStatus=='UNDER_INSPECTION'?16:10">
            <a-tabs v-model="activeTabKey">
          <a-col :span="!isDisplayConfirm?16:10">
            <a-tabs :active-key="activeTabKey" @change="handleTabChange">
              <a-tab-pane key="1" tab="日点检">
                <j-vxe-table ref="editableDetailTable" :rowNumber="false" rowSelection bordered
                <j-vxe-table ref="editableDetailTable1" :rowNumber="false" rowSelection bordered
                             alwaysEdit :toolbar="false" keep-source :height="300" :loading="detail.loading"
                             :dataSource="detail.dataSource" :columns="detail.columns"
                             @selectRowChange="handleTableSelectRowChange">
                             :dataSource="detail.dayInspectionList" :columns="detail.columns"
                             @selectRowChange="handleTableSelectRowChange($event,'Day')">
                  <template v-slot:inspectionResult="props">
                    <j-dict-select-tag v-model="props.row.inspectionResult" dictCode="eam_inspection_result"
                    <j-dict-select-tag v-model="props.row.inspectionResult" dictCode="inspection_project_result"
                                       :disabled="isDisableOperation" placeholder="请选择点检结果"
                                       @change="handleInspectionResultSelectChange($event,props.row)"
                                       style="width: 100%"/>
@@ -92,77 +92,63 @@
                  <template v-slot:exceptionDescription="props">
                    <a-textarea style="height: 32px" v-model="props.row.exceptionDescription"
                                :placeholder="props.row.inspectionResult==='2'?'请输入异常描述':''"
                                :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult==='1'"/>
                                :placeholder="props.row.inspectionResult&&props.row.inspectionResult!='NORMAL'?'请输入异常描述':''"
                                :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult=='NORMAL'"/>
                  </template>
                  <template v-slot:reportFlag="props">
                    <j-dict-select-tag v-model="props.row.reportFlag"
                                       :placeholder="props.row.inspectionResult==='2'?'请选择异常是否报修':''"
                                       :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult==='1'"
                                       :placeholder="props.row.inspectionResult&&props.row.inspectionResult!='NORMAL'?'请选择异常是否报修':''"
                                       :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult=='NORMAL'"
                                       dictCode="yn" style="width: 100%"/>
                  </template>
                </j-vxe-table>
              </a-tab-pane>
              <a-tab-pane key="2" tab="周点检">
                <j-vxe-table ref="editableDetailTable" :rowNumber="false" rowSelection bordered
              <a-tab-pane key="2" tab="周点检" forceRender>
                <j-vxe-table ref="editableDetailTable2" :rowNumber="false" rowSelection bordered
                             alwaysEdit :toolbar="false" keep-source :height="300" :loading="detail.loading"
                             :dataSource="detail.weekInspectionList" :columns="detail.columns"
                             @selectRowChange="handleTableSelectRowChange">
                             @selectRowChange="handleTableSelectRowChange($event,'Week')">
                  <template v-slot:inspectionResult="props">
                    <j-dict-select-tag v-model="props.row.inspectionResult" dictCode="eam_inspection_result"
                                       :disabled="isDisableOperation" placeholder="请选择点检结果"
                    <j-dict-select-tag v-model="props.row.inspectionResult" dictCode="inspection_project_result"
                                       :disabled="isDisableOperation||detail.weekInspectionFinishedFlag"
                                       placeholder="请选择点检结果"
                                       @change="handleInspectionResultSelectChange($event,props.row)"
                                       style="width: 100%"/>
                  </template>
                  <template v-slot:exceptionDescription="props">
                    <a-textarea style="height: 32px" v-model="props.row.exceptionDescription"
                                :placeholder="props.row.inspectionResult==='2'?'请输入异常描述':''"
                                :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult==='1'"/>
                                :placeholder="props.row.inspectionResult&&props.row.inspectionResult!='NORMAL'?'请输入异常描述':''"
                                :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult=='NORMAL'"/>
                  </template>
                  <template v-slot:reportFlag="props">
                    <j-dict-select-tag v-model="props.row.reportFlag"
                                       :placeholder="props.row.inspectionResult==='2'?'请选择异常是否报修':''"
                                       :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult==='1'"
                                       :placeholder="props.row.inspectionResult&&props.row.inspectionResult!='NORMAL'?'请选择异常是否报修':''"
                                       :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult=='NORMAL'"
                                       dictCode="yn" style="width: 100%"/>
                  </template>
                </j-vxe-table>
              </a-tab-pane>
              <template v-if="selectShenpiData.procInstId">
                <a-tab-pane key='3' 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='4' tab='流程图'>
                  <img :src="imageSrc" width="100%" v-if="imageSrc"/>
                <a-tab-pane key='3' tab='流程图'>
                  <img :src="imageSrc" v-if="imageSrc"/>
                </a-tab-pane>
              </template>
              <a-button
                v-if="selectedRowKeys.length>0&&!isDisableOperation&&hasInspectionDateArrived&&activeTabKey==='1'&&activeTabKey==='2'"
                v-if="activeTabKey=='1'||activeTabKey=='2'"
                :disabled="(activeTabKey=='1'&&selectedDayInspectionRowKeys.length==0)||(activeTabKey=='2'&&selectedWeekInspectionRowKeys.length==0)||(activeTabKey=='2'&&detail.weekInspectionFinishedFlag)||isDisableOperation"
                slot="tabBarExtraContent" type="primary"
                @click="handleSelectAllInspectionResult">批量点检正常
              </a-button>
            </a-tabs>
          </a-col>
          <a-col v-if="!disableSubmit&&isDisplayConfirm" :span="6">
          <a-col v-if="isDisplayConfirm" :span="6">
            <a-tabs>
              <a-tab-pane tab="维修工确认">
                <a-row>
@@ -211,7 +197,6 @@
        confirmLoading: false,
        spinning: false,
        tableRowRecord: {},
        hitaskDataSource: [],
        validatorRules: {
          confirmDealType: [
            { required: true, message: '请选择处理类型' }
@@ -240,8 +225,6 @@
          weekInspectionOrderList: '/eam/eamWeekInspectionDetail/queryStandardList'
        },
        detail: {
          loading: false,
          dataSource: [],
          columns: [
            {
              title: '序号',
@@ -296,18 +279,18 @@
              ]
            }
          ],
          weekInspectionList: []
          dayInspectionList: [],
          weekInspectionList: [],
          weekInspectionFinishedFlag: false
        },
        selectedRowKeys: [],
        selectedDayInspectionRowKeys: [],
        selectedWeekInspectionRowKeys: [],
        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)
      },
@@ -326,11 +309,6 @@
          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 => {
@@ -352,20 +330,70 @@
       */
      async getBasicInformation(record) {
        this.activeTabKey = '1'
        this.detail.dataSource = []
        this.detail.dayInspectionList = this.detail.weekInspectionList = []
        this.spinning = true
        const param = { id: record.dataId }
        let res = await getAction(this.url.queryById, param)
        this.tableRowRecord = Object.assign({}, res.result)
        this.loadDetail(record.dataId)
        this.getDayInspectionOrderListByApi(record.dataId)
        console.log('record', record)
        this.getWeekInspectionOrderListByApi(this.tableRowRecord.standardId)
      },
      /**
       * èŽ·å–ç‚¹æ£€å·¥å•ä¸­çš„æ—¥ç‚¹æ£€åˆ—è¡¨
       * @param orderId å·¥å•号
       */
      getDayInspectionOrderListByApi(orderId) {
        if (orderId) {
          getAction(this.url.detailList, { orderId })
            .then(res => {
              if (res.success) {
                this.detail.dayInspectionList = [...res.result]
              }
            })
            .finally(() => {
              this.spinning = false
            })
        }
      },
      /**
       * èŽ·å–ç‚¹æ£€å·¥å•ä¸­çš„å‘¨ç‚¹æ£€åˆ—è¡¨
       * @param standardId è§„范id
       */
      getWeekInspectionOrderListByApi(standardId) {
        console.log('standardId-------------------------', standardId)
        getAction(this.url.weekInspectionOrderList, { standardId, inspectionDate: this.tableRowRecord.inspectionDate })
          .then(res => {
            if (res.success) {
              this.detail.weekInspectionList = res.result.list
              this.detail.weekInspectionFinishedFlag = res.result.weekInsFlag
            }
          })
          .finally(() => {
            this.spinning = false
          })
      },
      handleTabChange(tabKey) {
        if (this.activeTabKey == '1') this.$refs.editableDetailTable1.clearValidate()
        this.activeTabKey = tabKey
      },
      // æäº¤äº‹ä»¶
      async submitForm() {
        let errMap = await this.$refs.editableDetailTable.validateTable()
        let errMap = await this.$refs.editableDetailTable1.validateTable()
        if (errMap) {
          console.log('err', errMap)
          if (this.activeTabKey != '1') {
            this.activeTabKey = '1'
            // å†…部校验提示因tab切换时定位出现问题因此在此处清楚内部校验提示,增加notification提示
            this.$refs.editableDetailTable1.clearValidate()
            this.$notification.warning({
              message: '消息',
              description: '日点检结果不能为空'
            })
          }
          return
        }
@@ -377,20 +405,26 @@
            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()
            flowTaskVo.tableDetailList = this.$refs.editableDetailTable1.getTableData()
            if (!this.detail.weekInspectionFinishedFlag) flowTaskVo.tableWeekDetailList = this.$refs.editableDetailTable2.getTableData()
            const that = this
            postAction(this.url.approve, flowTaskVo)
              .then((res) => {
                if (res.success) {
                  that.$message.success(res.message)
                  that.$notification.success({
                    message: '消息',
                    description: res.message
                  })
                  //刷新表格
                  that.$emit('searchReset')
                  that.$emit('modalFormOk')
                  that.handleCancel()
                } else {
                  that.$message.warning(res.message)
                  that.$notification.warning({
                    message: '消息',
                    description: res.message
                  })
                }
              })
              .finally(() => {
@@ -410,24 +444,37 @@
      // æ‰¹é‡é€‰æ‹©æ‰€æœ‰ç‚¹æ£€ç»“æžœ
      handleSelectAllInspectionResult() {
        this.selectedRowKeys.forEach(key => {
          const dataItem = this.detail.dataSource.find(item => item.id === key)
          if (dataItem && dataItem.inspectionResult !== '1') {
        let selectedRowKeys, prefix
        if (this.activeTabKey == '1') {
          selectedRowKeys = this.selectedDayInspectionRowKeys
          prefix = 'day'
        }
        else if (this.activeTabKey == '2') {
          selectedRowKeys = this.selectedWeekInspectionRowKeys
          prefix = 'week'
        }
        else selectedRowKeys = []
        if (selectedRowKeys.length == 0) return
        selectedRowKeys.forEach(key => {
          const dataItem = this.detail[prefix + 'InspectionList'].find(item => item.id === key)
          if (dataItem && dataItem.inspectionResult !== 'NORMAL') {
            delete dataItem.exceptionDescription
            delete dataItem.reportFlag
            dataItem.inspectionResult = '1'
            dataItem.inspectionResult = 'NORMAL'
          }
        })
        this.$refs.editableDetailTable.clearCheckboxRow()
        this.selectedRowKeys = []
        this.$refs['editableDetailTable' + this.activeTabKey].clearCheckboxRow()
        this['selected' + prefix.charAt(0).toUpperCase() + prefix.slice(1) + 'InspectionRowKeys'] = []
      },
      /**
       * è¡¨æ ¼å¤šé€‰æ¡†å‘生改变时触发
       * @param {selectedRowIds} è¡¨æ ¼ä¸­å·²é€‰æ‹©çš„ID列表
       * @param key ç‚¹æ£€åŒºåˆ†key
       */
      handleTableSelectRowChange({ selectedRowIds }) {
        this.selectedRowKeys = selectedRowIds
      handleTableSelectRowChange({ selectedRowIds }, key) {
        this['selected' + key + 'InspectionRowKeys'] = selectedRowIds
      },
      /**
@@ -440,10 +487,16 @@
        if (record.reportFlag) delete record.reportFlag
      },
      /**
       * å¼‚常描述与异常是否保修字段自定义校验方法
       * @param cellValue  å•元格内的值
       * @param row  å½“前行记录
       * @param callback ç»“果回调函数
       */
      customValidator({ cellValue, row }, callback) {
        if (row.inspectionResult === '2') {
        if (this.activeTabKey == '1' && row.inspectionResult != 'NORMAL') {
          if (!cellValue) {
            callback(false, '${title}不能为空!') // false = æœªé€šè¿‡ï¼Œå¯ä»¥è·Ÿè‡ªå®šä¹‰æç¤º
            callback(false, '请输入${title}') // false = æœªé€šè¿‡ï¼Œå¯ä»¥è·Ÿè‡ªå®šä¹‰æç¤º
          } else {
            callback(true) // true = é€šè¿‡éªŒè¯
          }
@@ -453,41 +506,8 @@
      },
      handleCancel() {
        this.selectedRowKeys = []
        this.selectedDayInspectionRowKeys = this.selectedWeekInspectionRowKeys = []
        this.visible = false
      },
      /**
       * èŽ·å–æ—¥ç‚¹æ£€æ˜Žç»†
       * @param orderId
       */
      loadDetail(orderId) {
        if (orderId) {
          getAction(this.url.detailList, { orderId })
            .then(res => {
              if (res.success) {
                this.detail.dataSource = [...res.result]
              }
            })
            .finally(() => {
              this.spinning = false
            })
        }
      },
      /**
       * èŽ·å–ç‚¹æ£€å·¥å•ä¸­çš„å‘¨ç‚¹æ£€åˆ—è¡¨
       * @param standardId è§„范id
       */
      getWeekInspectionOrderListByApi(standardId) {
        console.log('standardId-------------------------', standardId)
        getAction(this.url.weekInspectionOrderList, { standardId, inspectionDate: this.tableRowRecord.inspectionDate })
          .then(res => {
            if (res.success) this.detail.weekInspectionList = res.result
          })
          .finally(() => {
            this.spinning = false
          })
      }
    }
  }
src/views/system/SysParamsList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,214 @@
<template>
  <a-card :bordered="false">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <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="参数名称">
              <a-input placeholder="请输入参数名称" v-model="queryParam.settingName"/>
            </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>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <!-- <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('系统参数表')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> æ‰¹é‡æ“ä½œ <a-icon type="down" /></a-button>
      </a-dropdown>
    </div> -->
    <!-- table区域-begin -->
    <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"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        @change="handleTableChange">
        <span slot="rowIndex" slot-scope="text, record, index">
          {{(ipagination.current-1)*ipagination.pageSize+index+1}}
        </span>
        <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="uploadFile(text)">
            ä¸‹è½½
          </a-button>
        </template>
        <span slot="action" slot-scope="text, record">
         <a @click="handleEdit(record)">编辑</a>
         <!--   <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown> -->
          <template>
        <!-- <div v-if="record.settingValue=='OPEN'">
          <a-switch @click="edit(record)" checked-children="开" un-checked-children="关" default-checked />
        </div>
        <div v-else>
          <a-switch @click="edit(record)" checked-children="开" un-checked-children="关"  />
        </div> -->
      </template>
        </span>
        <!-- å­—符串超长截取省略号显示-->
        <span slot="settingValue" slot-scope="text">
          <j-ellipsis :value="text"/>
        </span>
      </a-table>
    </div>
    <sysParams-modal ref="modalForm" @ok="modalFormOk"></sysParams-modal>
  </a-card>
</template>
<script>
  import { httpAction } from '@/api/manage'
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import SysParamsModal from './modules/SysParamsModal'
  import JDictSelectTag from '../../components/dict/JDictSelectTag.vue'
  export default {
    name: "SysParamsList",
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      JDictSelectTag,
      SysParamsModal,
    },
    data () {
      return {
        description: '系统参数表管理页面',
        // è¡¨å¤´
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            scopedSlots: { customRender: 'rowIndex' }
          },
          {
            title:'参数名称',
            align:"center",
            dataIndex: 'settingName'
          },
          {
            title:'参数键',
            align:"center",
            dataIndex: 'settingKey'
          },
          {
            title:'参数值',
            align:"center",
            dataIndex: 'settingValue',
            key: 'settingValue',
            scopedSlots: { customRender: 'settingValue' }
          },
          {
            title:'备注',
            align:"center",
            dataIndex: 'remark'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            // fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/system/sysParams/list",
          delete: "/system/sysParams/delete",
          deleteBatch: "/system/sysParams/deleteBatch",
          exportXlsUrl: "/system/sysParams/exportXls",
          importExcelUrl: "system/sysParams/importExcel",
          edit: "/system/sysParams/edit",
        },
        dictOptions:{},
      }
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      initDictConfig(){
      },
      edit(sysParams) {
        if(sysParams.settingValue == "CLOSE"){
          sysParams.settingValue = "OPEN";
        }else{
          sysParams.settingValue = "CLOSE";
        }
      const that = this;
        httpAction("/system/sysParams/edit",sysParams,'put').then((res)=>{
        if(res.success){
        }else{
          that.$message.warning(res.message);
        }
      }).finally(() => {
        that.confirmLoading = false;
      })
    },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/system/modules/SysParamsModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,124 @@
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-form-item label="参数键" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input disabled v-decorator="['settingKey']" placeholder="请输入参数键"></a-input>
        </a-form-item>
        <a-form-item label="参数值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['settingValue']" placeholder="请输入参数值"></a-input>
        </a-form-item>
        <a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-textarea disabled v-decorator="['remark']" rows="4" placeholder="请输入备注"/>
        </a-form-item>
      </a-form>
    </a-spin>
  </j-modal>
</template>
<script>
  import { httpAction } from '@/api/manage'
  import pick from 'lodash.pick'
  import { validateDuplicateValue } from '@/utils/util'
  export default {
    name: "SysParamsModal",
    components: {
    },
    data () {
      return {
        form: this.$form.createForm(this),
        title:"操作",
        width:800,
        visible: false,
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
        },
        url: {
          add: "/system/sysParams/add",
          edit: "/system/sysParams/edit",
        }
      }
    },
    created () {
    },
    methods: {
      add () {
        this.edit({});
      },
      edit (record) {
        this.form.resetFields();
        this.model = Object.assign({}, record);
        this.visible = true;
        this.$nextTick(() => {
          this.form.setFieldsValue(pick(this.model,'settingKey','settingValue','remark'))
        })
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      handleOk () {
        const that = this;
        // è§¦å‘表单验证
        this.form.validateFields((err, values) => {
          if (!err) {
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.id){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
               method = 'put';
            }
            let formData = Object.assign(this.model, values);
            console.log("表单提交数据",formData)
            httpAction(httpurl,formData,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();
            })
          }
        })
      },
      handleCancel () {
        this.close()
      },
      popupCallback(row){
        this.form.setFieldsValue(pick(row,'settingKey','settingValue','remark'))
      },
    }
  }
</script>
src/views/system/modules/SysParamsModal__Style#Drawer.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,132 @@
<template>
  <a-drawer
    :title="title"
    :width="width"
    placement="right"
    :closable="false"
    @close="close"
    :visible="visible">
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-form-item label="参数键" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['settingKey']" placeholder="请输入参数键"></a-input>
        </a-form-item>
        <a-form-item label="参数值" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['settingValue']" placeholder="请输入参数值"></a-input>
        </a-form-item>
        <a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['remark']" placeholder="请输入备注"></a-input>
        </a-form-item>
      </a-form>
    </a-spin>
    <a-button type="primary" @click="handleOk">确定</a-button>
    <a-button type="primary" @click="handleCancel">取消</a-button>
  </a-drawer>
</template>
<script>
  import { httpAction } from '@/api/manage'
  import pick from 'lodash.pick'
  import { validateDuplicateValue } from '@/utils/util'
  export default {
    name: "SysParamsModal",
    components: {
    },
    data () {
      return {
        form: this.$form.createForm(this),
        title:"操作",
        width:800,
        visible: false,
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
        },
        url: {
          add: "/system/sysParams/add",
          edit: "/system/sysParams/edit",
        }
      }
    },
    created () {
    },
    methods: {
      add () {
        this.edit({});
      },
      edit (record) {
        this.form.resetFields();
        this.model = Object.assign({}, record);
        this.visible = true;
        this.$nextTick(() => {
          this.form.setFieldsValue(pick(this.model,'settingKey','settingValue','remark'))
        })
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      handleOk () {
        const that = this;
        // è§¦å‘表单验证
        this.form.validateFields((err, values) => {
          if (!err) {
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.id){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
               method = 'put';
            }
            let formData = Object.assign(this.model, values);
            console.log("表单提交数据",formData)
            httpAction(httpurl,formData,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();
            })
          }
        })
      },
      handleCancel () {
        this.close()
      },
      popupCallback(row){
        this.form.setFieldsValue(pick(row,'settingKey','settingValue','remark'))
      }
    }
  }
</script>
<style lang="less" scoped>
/** Button按钮间距 */
  .ant-btn {
    margin-left: 30px;
    margin-bottom: 30px;
    float: right;
  }
</style>