cuijian
2023-10-18 ca8cf61b9b31099ea843c36bf9da4740650cfbc9
操作证模块调整
已添加2个文件
已修改3个文件
630 ■■■■■ 文件已修改
src/views/eam/OperationCertificateApplyList.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/operationCertificate/OperationCertificateDetailList.vue 241 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/operationCertificateApply/OperationCertificateApplyDetailList.vue 264 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/operationCertificateApply/OperationCertificateApplyForm.vue 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/operationCertificateApply/OperationCertificateApplyModal.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/OperationCertificateApplyList.vue
@@ -38,11 +38,12 @@
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <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-button @click="handleAchievement" type="primary" icon="plus" v-if="selectedRowKeys.length == 1">成绩录入</a-button>
      <!-- é«˜çº§æŸ¥è¯¢åŒºåŸŸ -->
<!--      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
      <a-dropdown v-if="selectedRowKeys.length > 0">
@@ -115,8 +116,18 @@
      </a-table>
    </div>
    <a-tabs defaultActiveKey='1'>
      <a-tab-pane tab='操作证申请明细' key='1'>
        <div
          class='table-operator'
          style='margin:-20px'>
          <operation-certificate-apply-detail-list :mainId='operationCretificateApplyId' />
        </div>
    <operation-certificate-apply-modal ref="modalForm" @ok="modalFormOk"/>
      </a-tab-pane>
    </a-tabs>
    <operation-certificate-apply-modal ref="modalForm" @ok="modalFormOk" />
  </a-card>
</template>
@@ -125,17 +136,21 @@
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import OperationCertificateApplyModal from './modules/operationCertificateApply/OperationCertificateApplyModal'
  import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  import OperationCertificateApplyDetailList from './modules/operationCertificateApply/OperationCertificateApplyDetailList'
  import '@/assets/less/TableExpand.less'
  export default {
    name: "OperationCertificateApplyList",
    mixins:[JeecgListMixin],
    components: {
      OperationCertificateApplyModal
      OperationCertificateApplyModal,
      OperationCertificateApplyDetailList
    },
    data () {
      return {
        description: '操作证申请表管理页面',
        operationCretificateApplyId:'',
        selectedMainId: '',
        // è¡¨å¤´
        columns: [
          {
@@ -225,7 +240,46 @@
        fieldList.push({type:'string',value:'auditStatus',text:'审核状态',dictCode:'certificate_apply_status'})
        fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
        this.superFieldList = fieldList
      },
      handleEdit: function (record) {
      this.$refs.modalForm.edit(record);
      this.$refs.modalForm.title = "编辑";
      this.$refs.modalForm.disableSubmit = false;
    },
    handleAdd: function () {
      this.$refs.modalForm.add();
      this.$refs.modalForm.title = "新增";
      this.$refs.modalForm.disableSubmit = false;
    },
      handleAchievement(){
        this.$refs.modalForm.edit(this.selectionRows[0]);
        this.$refs.modalForm.title = "成绩录入";
        this.$refs.modalForm.disableSubmit = false;
        this.$refs.modalForm.isAchievement = true;
      },
      onSelectChange(selectedRowKeys, selectionRows) {
      if (selectedRowKeys.length == 1) {
        this.operationCretificateApplyId = selectionRows[0]['id']
      } else {
        this.operationCretificateApplyId = ''
      }
      this.selectedMainId = selectedRowKeys[0]
      this.selectedRowKeys = selectedRowKeys
      this.selectionRows = selectionRows
    },
    searchReset() {
      this.operationCretificateApplyId = ''
      this.queryParam = {}
      this.loadData(1)
    },
    onClearSelected() {
      this.selectedRowKeys = []
      this.selectionRows = []
      this.selectedMainId = ''
      this.operationCretificateApplyId = ''
    }
    }
  }
</script>
src/views/eam/modules/operationCertificate/OperationCertificateDetailList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,241 @@
<template>
  <a-card
    :bordered='false'
    :class="'cust-erp-sub-tab'"
  >
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class='table-page-search-wrapper'>
    </div>
    <div>
      <a-table
        ref='table'
        size='middle'
        bordered
        rowKey='id'
        :scroll="{ x: 'calc(1400px + 50%)', y: 900 }"
        :columns='columns'
        :dataSource='dataSource'
        :pagination='ipagination'
        :loading='loading'
        @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='takingInfo'
          slot-scope='text'
        >
          <span
            v-if='!text'
            style='font-size: 12px;font-style: italic;color: #126ee7;'
          >/</span>
          <span
            v-if='text'
            style='font-size: 12px;font-style: italic;'
          >{{ text }}</span>
        </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 v-if="record.uda1 == '不通过'">删除</a>
          </a-popconfirm>
        </span>
        <span
          slot="examinationConclusion"
          slot-scope="text, record"
        >
          <a
            v-if="record.examinationConclusion === 'N' "
          >不合格</a>
          <span v-else>合格</span>
        </span>
      </a-table>
    </div>
  </a-card>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction } from '@api/manage'
export default {
  name: 'OperationCertificateDetailList',
  mixins: [JeecgListMixin],
  props: {
    mainId: {
      type: String,
      default: '',
      required: false
    }
  },
  watch: {
    mainId: {
      immediate: true,
      handler(val) {
        if (!this.mainId) {
          this.clearList()
        } else {
          this.queryParam['id'] = val
          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: 'equipmentNames',
        },
        {
          title: '扣分项',
          align: 'center',
          dataIndex: 'appointmentCardNum',
        },
        {
          title: '扣除分数',
          align: 'center',
          dataIndex: 'replaceReason',
        },
        {
          title: '扣分周期',
          align: 'center',
          dataIndex: 'theoreticalResults',
        }
      ],
      url: {
        list: '/eam/operationCertificate/queryOperationCertificateDetailByMainId'
      },
      dictOptions: {
        type: [],
        inventoryStatus: []
      }
    }
  },
  created() {
  },
  computed: {
    importExcelUrl() {
      return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`
    }
  },
  methods: {
    clearList() {
      this.dataSource = []
      this.selectedRowKeys = []
      this.ipagination.current = 1
    },
    loadData(arg) {
      if (!this.url.list) {
        this.$message.error('请设置url.list属性!')
        return
      }
      //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
      if (arg === 1) {
        this.ipagination.current = 1
      }
      var params = this.getQueryParams()//查询条件
      this.loading = true
      getAction(this.url.list, params).then((res) => {
        if (res.success) {
          //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
          this.dataSource = res.result.records || res.result
          if (res.result.total) {
            this.ipagination.total = res.result.total
          } else {
            this.ipagination.total = 0
          }
          //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
        } else {
          this.$message.warning(res.message)
        }
      }).finally(() => {
        this.loading = false
      })
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
src/views/eam/modules/operationCertificateApply/OperationCertificateApplyDetailList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,264 @@
<template>
  <a-card
    :bordered='false'
    :class="'cust-erp-sub-tab'"
  >
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class='table-page-search-wrapper'>
    </div>
    <div>
      <a-table
        ref='table'
        size='middle'
        bordered
        rowKey='id'
        :scroll="{ x: 'calc(1400px + 50%)', y: 900 }"
        :columns='columns'
        :dataSource='dataSource'
        :pagination='ipagination'
        :loading='loading'
        @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='takingInfo'
          slot-scope='text'
        >
          <span
            v-if='!text'
            style='font-size: 12px;font-style: italic;color: #126ee7;'
          >/</span>
          <span
            v-if='text'
            style='font-size: 12px;font-style: italic;'
          >{{ text }}</span>
        </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 v-if="record.uda1 == '不通过'">删除</a>
          </a-popconfirm>
        </span>
        <span
          slot="examinationConclusion"
          slot-scope="text, record"
        >
          <a
            v-if="record.examinationConclusion === 'N' "
          >不合格</a>
          <span v-else>合格</span>
        </span>
      </a-table>
    </div>
  </a-card>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction } from '@api/manage'
export default {
  name: 'OperationCertificateApplyDetailList',
  mixins: [JeecgListMixin],
  props: {
    mainId: {
      type: String,
      default: '',
      required: false
    }
  },
  watch: {
    mainId: {
      immediate: true,
      handler(val) {
        if (!this.mainId) {
          this.clearList()
        } else {
          this.queryParam['id'] = val
          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: 'realname',
        },
        {
          title: '设备统一编码',
          align: 'center',
          dataIndex: 'equipmentNames',
        },
        {
          title: '上岗证号',
          align: 'center',
          dataIndex: 'appointmentCardNum',
        },
        {
          title: '补办原因',
          align: 'center',
          dataIndex: 'replaceReason',
        },
        {
          title: '理论成绩',
          align: 'center',
          dataIndex: 'theoreticalResults',
        },
        {
          title: '实操成绩',
          align: 'center',
          dataIndex: 'actualPerformance',
        },
        {
          title: '考试结论',
          align: 'center',
          dataIndex: 'examinationConclusion',
          scopedSlots: { customRender: 'examinationConclusion' },
        },
        {
          title: '备注',
          align: 'center',
          dataIndex: 'remark',
        }
      ],
      url: {
        list: '/eam/operationCertificateApply/queryOperationCertificateApplyDetailByMainId'
      },
      dictOptions: {
        type: [],
        inventoryStatus: []
      }
    }
  },
  created() {
  },
  computed: {
    importExcelUrl() {
      return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`
    }
  },
  methods: {
    clearList() {
      this.dataSource = []
      this.selectedRowKeys = []
      this.ipagination.current = 1
    },
    loadData(arg) {
      if (!this.url.list) {
        this.$message.error('请设置url.list属性!')
        return
      }
      //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
      if (arg === 1) {
        this.ipagination.current = 1
      }
      var params = this.getQueryParams()//查询条件
      this.loading = true
      getAction(this.url.list, params).then((res) => {
        if (res.success) {
          //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
          this.dataSource = res.result.records || res.result
          if (res.result.total) {
            this.ipagination.total = res.result.total
          } else {
            this.ipagination.total = 0
          }
          //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
        } else {
          this.$message.warning(res.message)
        }
      }).finally(() => {
        this.loading = false
      })
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
src/views/eam/modules/operationCertificateApply/OperationCertificateApplyForm.vue
@@ -66,7 +66,7 @@
<script>
import { getAction } from '@/api/manage'
import { getAction,httpAction } from '@/api/manage'
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
import { JVXETypes } from '@/components/jeecg/JVxeTable'
import { getRefPromise, VALIDATE_FAILED } from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
@@ -82,6 +82,7 @@
  },
  data() {
    return {
      isAchievement:false,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
@@ -173,7 +174,8 @@
            type: JVXETypes.input,
            width: '200px',
            placeholder: '请输入${title}',
            defaultValue: ''
            defaultValue: '',
            disabled:false
          },
          {
            title: '实操成绩',
@@ -181,7 +183,8 @@
            type: JVXETypes.input,
            width: '200px',
            placeholder: '请输入${title}',
            defaultValue: ''
            defaultValue: '',
            disabled:false
          },
          {
            title: '考试结论',
@@ -190,21 +193,23 @@
            customValue: ['Y', 'N'],
            width: '200px',
            placeholder: '请输入${title}',
            defaultValue: ''
            defaultValue: '',
            disabled:false
          },
          {
            title: '状态',
            key: 'status',
            type: JVXETypes.input,
            width: '200px',
            placeholder: '请输入${title}',
            defaultValue: ''
          }
          // {
          //   title: '状态',
          //   key: 'status',
          //   type: JVXETypes.input,
          //   width: '200px',
          //   placeholder: '请输入${title}',
          //   defaultValue: ''
          // }
        ]
      },
      url: {
        add: '/eam/operationCertificateApply/add',
        edit: '/eam/operationCertificateApply/edit',
        addOperationCertificate:'/eam/operationCertificate/addOperationCertificate',
        queryById: '/eam/operationCertificateApply/queryById',
        operationCertificateApplyDetail: {
          list: '/eam/operationCertificateApply/queryOperationCertificateApplyDetailByMainId'
@@ -218,7 +223,7 @@
      type: Boolean,
      default: false,
      required: false
    }
    },
  },
  computed: {
    formDisabled() {
@@ -270,7 +275,34 @@
    },
    validateError(msg) {
      this.$message.error(msg)
    }
    },
    request(formData) {
      let url = this.url.add, method = 'post'
      if (this.model.id) {
        url = this.url.edit
        method = 'put'
      }
      this.confirmLoading = true
      console.log("formData===>",formData);
      httpAction(url, formData, method).then((res) => {
        if (res.success) {
          httpAction(this.url.addOperationCertificate, formData.operationCertificateApplyDetailList, 'post').then((res) => {
            if (res.success) {
              this.$message.success(res.message)
            }else {
              this.$message.warning(res.message)
            }
          })
          this.$message.success(res.message)
          this.$emit('ok')
          this.close()
        } else {
          this.$message.warning(res.message)
        }
      }).finally(() => {
        this.confirmLoading = false
      })
    },
  }
}
src/views/eam/modules/operationCertificateApply/OperationCertificateApplyModal.vue
@@ -26,7 +26,8 @@
        title:'',
        width:800,
        visible: false,
        disableSubmit: false
        disableSubmit: false,
        isAchievement:false
      }
    },
    methods:{
@@ -40,7 +41,9 @@
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.edit(record);
          this.$refs.realForm.isAchievement = true;
        })
        console.log("123123123123",this.isAchievement)
      },
      close () {
        this.$emit('close');