From ca8cf61b9b31099ea843c36bf9da4740650cfbc9 Mon Sep 17 00:00:00 2001
From: cuijian <cuijian@xalxzn.com>
Date: 星期三, 18 十月 2023 16:53:33 +0800
Subject: [PATCH] 操作证模块调整

---
 src/views/eam/modules/operationCertificate/OperationCertificateDetailList.vue           |  241 +++++++++++++++++++++
 src/views/eam/modules/operationCertificateApply/OperationCertificateApplyForm.vue       |   60 ++++-
 src/views/eam/OperationCertificateApplyList.vue                                         |   60 +++++
 src/views/eam/modules/operationCertificateApply/OperationCertificateApplyDetailList.vue |  264 ++++++++++++++++++++++++
 src/views/eam/modules/operationCertificateApply/OperationCertificateApplyModal.vue      |    5 
 5 files changed, 612 insertions(+), 18 deletions(-)

diff --git a/src/views/eam/OperationCertificateApplyList.vue b/src/views/eam/OperationCertificateApplyList.vue
index 6c86750..1bdf51b 100644
--- a/src/views/eam/OperationCertificateApplyList.vue
+++ b/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>
diff --git a/src/views/eam/modules/operationCertificate/OperationCertificateDetailList.vue b/src/views/eam/modules/operationCertificate/OperationCertificateDetailList.vue
new file mode 100644
index 0000000..3a20e21
--- /dev/null
+++ b/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: '鎵e垎璁惧',
+          align: 'center',
+          dataIndex: 'equipmentNames',
+
+        },
+        {
+          title: '鎵e垎椤�',
+          align: 'center',
+          dataIndex: 'appointmentCardNum',
+
+        },
+        {
+          title: '鎵i櫎鍒嗘暟',
+          align: 'center',
+          dataIndex: 'replaceReason',
+
+        },
+        {
+          title: '鎵e垎鍛ㄦ湡',
+          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('璇疯缃畊rl.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>
diff --git a/src/views/eam/modules/operationCertificateApply/OperationCertificateApplyDetailList.vue b/src/views/eam/modules/operationCertificateApply/OperationCertificateApplyDetailList.vue
new file mode 100644
index 0000000..e2e5190
--- /dev/null
+++ b/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('璇疯缃畊rl.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>
diff --git a/src/views/eam/modules/operationCertificateApply/OperationCertificateApplyForm.vue b/src/views/eam/modules/operationCertificateApply/OperationCertificateApplyForm.vue
index 16a4a2b..9745f0c 100644
--- a/src/views/eam/modules/operationCertificateApply/OperationCertificateApplyForm.vue
+++ b/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
+      })
+    },
 
   }
 }
diff --git a/src/views/eam/modules/operationCertificateApply/OperationCertificateApplyModal.vue b/src/views/eam/modules/operationCertificateApply/OperationCertificateApplyModal.vue
index 047354b..c2baf1d 100644
--- a/src/views/eam/modules/operationCertificateApply/OperationCertificateApplyModal.vue
+++ b/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');

--
Gitblit v1.9.3