From 48ea29772a71aafb7c687a62a5ba4ecc9b6635a8 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期四, 29 五月 2025 13:39:27 +0800
Subject: [PATCH] 备件请购功能

---
 src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionModal.vue        |  145 +++++++
 src/views/flowable/workflow/sparePartApply/SparePartApplyHandle.vue                         |  503 +++++++++++++++++++++++++
 src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionDetailModal.vue  |  117 +++++
 src/views/flowable/workflow/FlowTodo.vue                                                    |  271 ++++++++++---
 src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionExamineModal.vue |  122 ++++++
 5 files changed, 1,094 insertions(+), 64 deletions(-)

diff --git a/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionDetailModal.vue b/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionDetailModal.vue
new file mode 100644
index 0000000..e7c17a2
--- /dev/null
+++ b/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionDetailModal.vue
@@ -0,0 +1,117 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    switchFullscreen
+    @ok="handleOk"
+    @cancel="handleCancel"
+    cancelText="鍏抽棴">
+
+    <a-spin :spinning="confirmLoading">
+      <a-form-model ref="form" :model="model" :rules="validatorRules">
+
+        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag" label="鍒犻櫎鏍囪">
+          <a-input-number v-model="model.delFlag"/>
+        </a-form-model-item>
+        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partId" label="澶囧搧澶囦欢ID">
+          <a-input placeholder="璇疯緭鍏ュ鍝佸浠禝D" v-model="model.partId" />
+        </a-form-model-item>
+        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="requisitionNum" label="璇疯喘鏁伴噺">
+          <a-input placeholder="璇疯緭鍏ヨ璐暟閲�" v-model="model.requisitionNum" />
+        </a-form-model-item>
+
+      </a-form-model>
+    </a-spin>
+  </j-modal>
+</template>
+
+<script>
+  import { httpAction } from '@api/manage'
+  import moment from "moment"
+
+  export default {
+    name: "EamSparePartRequisitionDetailModal",
+    data () {
+      return {
+        title:"鎿嶄綔",
+        visible: false,
+        model: {},
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+
+        confirmLoading: false,
+        validatorRules:{
+        },
+        url: {
+          add: "/eam/eamSparePartRequisitionDetail/add",
+          edit: "/eam/eamSparePartRequisitionDetail/edit",
+        },
+      }
+    },
+    created () {
+    },
+    methods: {
+      add () {
+        //鍒濆鍖栭粯璁ゅ��
+        this.edit({});
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+        this.$refs.form.clearValidate();
+      },
+      handleOk () {
+        const that = this;
+        // 瑙﹀彂琛ㄥ崟楠岃瘉
+         this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,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();
+            })
+          }else{
+             return false;
+          }
+        })
+      },
+      handleCancel () {
+        this.close()
+      },
+
+
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+
+</style>
\ No newline at end of file
diff --git a/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionExamineModal.vue b/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionExamineModal.vue
new file mode 100644
index 0000000..f3e9ca5
--- /dev/null
+++ b/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionExamineModal.vue
@@ -0,0 +1,122 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    switchFullscreen
+    :cancel="close"
+  >
+
+    <a-spin :spinning="confirmLoading">
+      <a-form-model
+        ref="form"
+        :model="model"
+        :rules="validatorRules"
+      >
+        <a-form-model-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          prop="requisitionCode"
+          label="璇疯喘鍗曠紪鐮�"
+        >
+          <a-input
+            placeholder="璇疯喘鍗曠紪鐮佽嚜鍔ㄧ敓鎴�"
+            v-model="model.requisitionCode"
+            :disabled="true"
+          />
+        </a-form-model-item>
+      </a-form-model>
+    </a-spin>
+
+    <template slot='footer'>
+      <a-popconfirm
+        @confirm="handleReject"
+        title="纭灏嗗綋鍓嶅浠惰璐崟椹冲洖锛�"
+      >
+        <a-button
+          :loading='confirmLoading'
+          :style="{marginRight: '8px'}"
+        >椹冲洖</a-button>
+      </a-popconfirm>
+      <a-popconfirm
+        @confirm="handleOk"
+        title="纭灏嗗綋鍓嶅浠惰璐崟瀹℃牳閫氳繃锛�"
+      >
+        <a-button
+          type='primary'
+          :loading='confirmLoading'
+          :style="{marginRight: '8px'}"
+        >閫氳繃</a-button>
+      </a-popconfirm>
+    </template>
+  </j-modal>
+</template>
+
+<script>
+import { postAction } from '@api/manage'
+
+export default {
+  name: "EamSparePartRequisitionExamineModal",
+  data() {
+    return {
+      title: "瀹℃牳",
+      visible: false,
+      model: {},
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+
+      confirmLoading: false,
+      validatorRules: {
+      },
+      url: {
+        examine: "eam/eamSparePartRequisition/examineSpareRequisition"
+      },
+    }
+  },
+  created() {
+  },
+  methods: {
+    examine(record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+    close() {
+      this.$emit('close');
+      this.visible = false;
+    },
+    handleOk() {
+      this.handleSubmit("3");
+    },
+    handleReject() {
+      this.handleSubmit("4");
+    },
+    handleSubmit(status) {
+      const that = this;
+      that.model.requisitionStatus = status;
+      postAction(that.url.examine, that.model).then((res) => {
+        if (res.success) {
+          that.$message.success(res.message);
+          that.$emit('ok');
+        } else {
+          that.$message.warning(res.message);
+        }
+      }).catch(() => {
+        that.$message.error('鎿嶄綔澶辫触锛岃绋嶅悗閲嶈瘯');
+      }).finally(() => {
+        that.confirmLoading = false;
+        that.close();
+      });
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+</style>
\ No newline at end of file
diff --git a/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionModal.vue b/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionModal.vue
new file mode 100644
index 0000000..c0781ad
--- /dev/null
+++ b/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionModal.vue
@@ -0,0 +1,145 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    switchFullscreen
+    @ok="handleOk"
+    @cancel="handleCancel"
+    cancelText="鍏抽棴"
+  >
+
+    <a-spin :spinning="confirmLoading">
+      <a-form-model
+        ref="form"
+        :model="model"
+        :rules="validatorRules"
+      >
+        <a-form-model-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          prop="requisitionCode"
+          label="璇疯喘鍗曠紪鐮�"
+        >
+          <a-input
+            placeholder="璇疯喘鍗曠紪鐮佽嚜鍔ㄧ敓鎴�"
+            v-model="model.requisitionCode"
+            :disabled="true"
+          />
+        </a-form-model-item>
+        <a-form-model-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          prop="remark"
+          label="澶囨敞"
+        >
+          <a-textarea
+            placeholder="璇疯緭鍏ュ娉�"
+            v-model="model.remark"
+          />
+        </a-form-model-item>
+      </a-form-model>
+    </a-spin>
+  </j-modal>
+</template>
+
+<script>
+import { httpAction, getAction } from '@api/manage'
+import moment from "moment"
+
+export default {
+  name: "EamSparePartRequisitionModal",
+  data() {
+    return {
+      title: "鎿嶄綔",
+      visible: false,
+      model: {},
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+
+      confirmLoading: false,
+      validatorRules: {},
+      url: {
+        add: "/eam/eamSparePartRequisition/add",
+        edit: "/eam/eamSparePartRequisition/edit",
+        generateRequisitionCode: "sys/sysBusinessCodeRule/generateBusinessCodeSeq"
+      },
+    }
+  },
+  created() {
+  },
+  methods: {
+    add() {
+      const that = this
+      let params = {
+        businessCode: "SpareRequisitionCodeRule"
+      }
+      getAction(that.url.generateRequisitionCode, params).then((res) => {
+        if (res.success) {
+          this.model = {
+            requisitionCode: res.result
+          }
+        } else {
+          that.$message.warning(res.message);
+        }
+      })
+      //鍒濆鍖栭粯璁ゅ��
+      that.edit(this.model);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+    close() {
+      this.$emit('close');
+      this.visible = false;
+      this.$refs.form.clearValidate();
+    },
+    handleOk() {
+      const that = this;
+      // 瑙﹀彂琛ㄥ崟楠岃瘉
+      this.$refs.form.validate(valid => {
+        if (valid) {
+          that.confirmLoading = true;
+          let httpurl = '';
+          let method = '';
+          if (!this.model.id) {
+            httpurl += this.url.add;
+            method = 'post';
+          } else {
+            httpurl += this.url.edit;
+            method = 'put';
+          }
+          httpAction(httpurl, this.model, 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();
+          })
+        } else {
+          return false;
+        }
+      })
+    },
+    handleCancel() {
+      this.close()
+    },
+
+  }
+}
+</script>
+
+<style lang="less" scoped>
+</style>
\ No newline at end of file
diff --git a/src/views/flowable/workflow/FlowTodo.vue b/src/views/flowable/workflow/FlowTodo.vue
index af6ba4b..7f23a43 100644
--- a/src/views/flowable/workflow/FlowTodo.vue
+++ b/src/views/flowable/workflow/FlowTodo.vue
@@ -7,12 +7,23 @@
   <a-card :bordered='false'>
     <!-- 鏌ヨ鍖哄煙 -->
     <div class='table-page-search-wrapper'>
-      <a-form layout='inline' @keyup.enter.native='searchQuery'>
+      <a-form
+        layout='inline'
+        @keyup.enter.native='searchQuery'
+      >
         <a-row :gutter='24'>
-          <a-col :lg='6' :md='8' :sm='24' :xl='4'>
+          <a-col
+            :lg='6'
+            :md='8'
+            :sm='24'
+            :xl='4'
+          >
             <a-form-item label='娴佺▼鍒嗙被'>
-              <j-dict-select-tag v-model='queryParam.category' dictCode='flow_type'
-                                 placeholder='璇烽�夋嫨娴佺▼鍒嗙被'></j-dict-select-tag>
+              <j-dict-select-tag
+                v-model='queryParam.category'
+                dictCode='flow_type'
+                placeholder='璇烽�夋嫨娴佺▼鍒嗙被'
+              ></j-dict-select-tag>
             </a-form-item>
           </a-col>
           <!--<a-col :xl="4" :lg="6" :md="8" :sm="24">-->
@@ -20,35 +31,83 @@
           <!--<a-input placeholder="璇疯緭鍏ユ祦绋嬪悕绉�" v-model="queryParam.flowName"></a-input>-->
           <!--</a-form-item>-->
           <!--</a-col>-->
-          <a-col :lg='6' :md='8' :sm='24' :xl='4'>
+          <a-col
+            :lg='6'
+            :md='8'
+            :sm='24'
+            :xl='4'
+          >
             <a-form-item label='褰撳墠鑺傜偣'>
-              <a-input v-model='queryParam.name' placeholder='璇疯緭鍏ュ綋鍓嶈妭鐐圭簿纭煡璇�'></a-input>
+              <a-input
+                v-model='queryParam.name'
+                placeholder='璇疯緭鍏ュ綋鍓嶈妭鐐圭簿纭煡璇�'
+              ></a-input>
             </a-form-item>
           </a-col>
-          <a-col :lg='6' :md='8' :sm='24' :xl='4'>
+          <a-col
+            :lg='6'
+            :md='8'
+            :sm='24'
+            :xl='4'
+          >
             <a-form-item label='绠�瑕佹弿杩�'>
-              <a-input v-model='queryParam.title' placeholder='璇疯緭鍏ョ畝瑕佹弿杩�'></a-input>
+              <a-input
+                v-model='queryParam.title'
+                placeholder='璇疯緭鍏ョ畝瑕佹弿杩�'
+              ></a-input>
             </a-form-item>
           </a-col>
           <template v-if='toggleSearchStatus'>
-            <a-col :lg='8' :md='12' :sm='24' :xl='8'>
+            <a-col
+              :lg='8'
+              :md='12'
+              :sm='24'
+              :xl='8'
+            >
               <a-form-item label='浠诲姟鏃堕棿鑼冨洿'>
-                <j-date v-model='queryParam.startTime' :show-time='false' class='query-group-cust'
-                        date-format='YYYY-MM-DD HH:mm:ss'
-                        placeholder='璇烽�夋嫨寮�濮嬫椂闂�'></j-date>
+                <j-date
+                  v-model='queryParam.startTime'
+                  :show-time='false'
+                  class='query-group-cust'
+                  date-format='YYYY-MM-DD HH:mm:ss'
+                  placeholder='璇烽�夋嫨寮�濮嬫椂闂�'
+                ></j-date>
                 <span class='query-group-split-cust'></span>
-                <j-date v-model='queryParam.endTime' :show-time='false' class='query-group-cust'
-                        date-format='YYYY-MM-DD HH:mm:ss'
-                        placeholder='璇烽�夋嫨缁撴潫鏃堕棿'></j-date>
+                <j-date
+                  v-model='queryParam.endTime'
+                  :show-time='false'
+                  class='query-group-cust'
+                  date-format='YYYY-MM-DD HH:mm:ss'
+                  placeholder='璇烽�夋嫨缁撴潫鏃堕棿'
+                ></j-date>
               </a-form-item>
             </a-col>
           </template>
 
-          <a-col :lg='6' :md='8' :sm='24' :xl='4'>
-            <span class='table-page-search-submitButtons' style='float: left;overflow: hidden;'>
-              <a-button icon='search' type='primary' @click='searchQuery'>鏌ヨ</a-button>
-              <a-button icon='reload' style='margin-left: 8px' @click='searchReset'>閲嶇疆</a-button>
-               <a style='margin-left: 8px' @click='handleToggleSearch'>
+          <a-col
+            :lg='6'
+            :md='8'
+            :sm='24'
+            :xl='4'
+          >
+            <span
+              class='table-page-search-submitButtons'
+              style='float: left;overflow: hidden;'
+            >
+              <a-button
+                icon='search'
+                type='primary'
+                @click='searchQuery'
+              >鏌ヨ</a-button>
+              <a-button
+                icon='reload'
+                style='margin-left: 8px'
+                @click='searchReset'
+              >閲嶇疆</a-button>
+              <a
+                style='margin-left: 8px'
+                @click='handleToggleSearch'
+              >
                 {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }}
                 <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
               </a>
@@ -63,7 +122,10 @@
     <div class='table-operator'>
       <a-dropdown v-if='selectedRowKeys.length > 0 '>
         <a-menu slot='overlay'>
-          <a-menu-item key='1' @click='batchHandle'>
+          <a-menu-item
+            key='1'
+            @click='batchHandle'
+          >
             <a-icon type='delete' />
             鎵归噺澶勭悊
           </a-menu-item>
@@ -76,10 +138,16 @@
 
     <!-- table鍖哄煙-begin -->
     <div>
-      <div class='ant-alert ant-alert-info' style='margin-bottom: 16px;'>
+      <div
+        class='ant-alert ant-alert-info'
+        style='margin-bottom: 16px;'
+      >
         <i class='anticon anticon-info-circle ant-alert-icon'></i>宸查�夋嫨&nbsp;<a style='font-weight: 600'>{{
           selectedRowKeys.length }}</a>椤�&nbsp;&nbsp;
-        <a style='margin-left: 24px' @click='onClearSelected'>娓呯┖</a>
+        <a
+          style='margin-left: 24px'
+          @click='onClearSelected'
+        >娓呯┖</a>
       </div>
 
       <a-table
@@ -93,54 +161,115 @@
         bordered
         rowKey='id'
         size='middle'
-        @change='handleTableChange'>
+        @change='handleTableChange'
+      >
 
-        <span slot='action' slot-scope='text, record'>
-            <a @click='handelDetail(record,text)'>鎵ц/瀹℃壒</a>
+        <span
+          slot='action'
+          slot-scope='text, record'
+        >
+          <a @click='handelDetail(record,text)'>鎵ц/瀹℃壒</a>
         </span>
 
       </a-table>
     </div>
-    <AssignFileStreamHandle ref='modalFormApproval' :selectShenpiData='selectShenpiData'
-                            @searchReset='searchReset'></AssignFileStreamHandle>
-    <DispatchFileHandle ref='modalFormDispatchFileXq' :selectShenpiData='selectDispatchFileXqData'
-                        @searchReset='searchReset'></DispatchFileHandle>
-    <DispatchFileBachHandleStyle ref='modalFormDispatchFileBatch' @ok='modalFormOk'
-                                 @searchReset='searchReset'></DispatchFileBachHandleStyle>
+    <AssignFileStreamHandle
+      ref='modalFormApproval'
+      :selectShenpiData='selectShenpiData'
+      @searchReset='searchReset'
+    ></AssignFileStreamHandle>
+    <DispatchFileHandle
+      ref='modalFormDispatchFileXq'
+      :selectShenpiData='selectDispatchFileXqData'
+      @searchReset='searchReset'
+    ></DispatchFileHandle>
+    <DispatchFileBachHandleStyle
+      ref='modalFormDispatchFileBatch'
+      @ok='modalFormOk'
+      @searchReset='searchReset'
+    ></DispatchFileBachHandleStyle>
     <!--鍗曚釜娴佺▼澶勭悊-->
-    <InspectionOrderHandle ref='modalFormInspectionOrder' :selectShenpiData='selectInspectionOrderData'
-                           @searchReset='searchReset'></InspectionOrderHandle>
-    <week-maintenance-approval-modal ref='weekMaintenanceApprovalModal' :selectShenpiData='selectWeekMaintenanceData'
-                                     @searchReset='searchReset'></week-maintenance-approval-modal>
-    <repair-order-approval-modal ref='repairOrderApprovalModal' :selectShenpiData='selectRepairOrderData'
-                                 @searchReset='searchReset'></repair-order-approval-modal>
-    <out-bound-order-handle ref='outBoundOrderHandle' :selectShenpiData='selectOutBoundOrderData'
-                            @searchReset='searchReset'></out-bound-order-handle>
-    <stocktaking-bound-handle ref='stocktakingBoundHandle' :selectShenpiData='selectStocktakingBoundOrderData'
-                              @searchReset='searchReset'></stocktaking-bound-handle>
+    <InspectionOrderHandle
+      ref='modalFormInspectionOrder'
+      :selectShenpiData='selectInspectionOrderData'
+      @searchReset='searchReset'
+    ></InspectionOrderHandle>
+    <week-maintenance-approval-modal
+      ref='weekMaintenanceApprovalModal'
+      :selectShenpiData='selectWeekMaintenanceData'
+      @searchReset='searchReset'
+    ></week-maintenance-approval-modal>
+    <repair-order-approval-modal
+      ref='repairOrderApprovalModal'
+      :selectShenpiData='selectRepairOrderData'
+      @searchReset='searchReset'
+    ></repair-order-approval-modal>
+    <out-bound-order-handle
+      ref='outBoundOrderHandle'
+      :selectShenpiData='selectOutBoundOrderData'
+      @searchReset='searchReset'
+    ></out-bound-order-handle>
+    <stocktaking-bound-handle
+      ref='stocktakingBoundHandle'
+      :selectShenpiData='selectStocktakingBoundOrderData'
+      @searchReset='searchReset'
+    ></stocktaking-bound-handle>
 
-
-    <loss-bound-handle ref='lossBoundHandle' :selectShenpiData='selectLossBoundOrderData'
-                       @searchReset='searchReset'></loss-bound-handle>
+    <loss-bound-handle
+      ref='lossBoundHandle'
+      :selectShenpiData='selectLossBoundOrderData'
+      @searchReset='searchReset'
+    ></loss-bound-handle>
 
     <!--鎵归噺澶勭悊-->
-    <inspection-order-batch-handle ref='inspectionOrderBatchHandleRef' :taskList='selectionRows'
-                                   @searchReset='searchReset' />
+    <inspection-order-batch-handle
+      ref='inspectionOrderBatchHandleRef'
+      :taskList='selectionRows'
+      @searchReset='searchReset'
+    />
 
-    <week-maintenance-batch-approval-modal ref='weenMaintenanceBatchApprovalModalRef' :taskList='selectionRows'
-                                           @searchReset='searchReset' />
-    <equipment-lean-out-approval-modal ref='equipmentLeanOutApprovalModelRef' @searchReset='searchReset' />
+    <week-maintenance-batch-approval-modal
+      ref='weenMaintenanceBatchApprovalModalRef'
+      :taskList='selectionRows'
+      @searchReset='searchReset'
+    />
+    <equipment-lean-out-approval-modal
+      ref='equipmentLeanOutApprovalModelRef'
+      @searchReset='searchReset'
+    />
 
-    <second-maintenance-approval-modal ref='secondMaintenanceApprovalModal'
-                                       :selectShenpiData='selectSecondMaintenanceData'
-                                       @searchReset='searchReset'></second-maintenance-approval-modal>
-    <third-maintenance-approval-modal ref='thirdMaintenanceApprovalModal' :selectShenpiData='selectThirdMaintenanceData'
-                                      @searchReset='searchReset'></third-maintenance-approval-modal>
-    <equipment-seal-up-approval-modal ref='equipmentSealUpApprovalModelRef' @searchReset='searchReset' />
-    <inbound-order-handle ref='inboundOrderApprovalModal' :selectInboundOrderData='selectInboundOrderData'
-                          @searchReset='searchReset'></inbound-order-handle>
-    <equipment-transfer-approval-modal ref='equipmentTransferApprovalModelRef' @searchReset='searchReset' />
-    <equipment-scrap-approval-modal ref='equipmentScrapApprovalModelRef' @searchReset='searchReset' />
+    <second-maintenance-approval-modal
+      ref='secondMaintenanceApprovalModal'
+      :selectShenpiData='selectSecondMaintenanceData'
+      @searchReset='searchReset'
+    ></second-maintenance-approval-modal>
+    <third-maintenance-approval-modal
+      ref='thirdMaintenanceApprovalModal'
+      :selectShenpiData='selectThirdMaintenanceData'
+      @searchReset='searchReset'
+    ></third-maintenance-approval-modal>
+    <equipment-seal-up-approval-modal
+      ref='equipmentSealUpApprovalModelRef'
+      @searchReset='searchReset'
+    />
+    <inbound-order-handle
+      ref='inboundOrderApprovalModal'
+      :selectInboundOrderData='selectInboundOrderData'
+      @searchReset='searchReset'
+    ></inbound-order-handle>
+    <equipment-transfer-approval-modal
+      ref='equipmentTransferApprovalModelRef'
+      @searchReset='searchReset'
+    />
+    <equipment-scrap-approval-modal
+      ref='equipmentScrapApprovalModelRef'
+      @searchReset='searchReset'
+    />
+    <spare-part-apply-handle
+      ref='sparePartApplyModal'
+      :selectSparePartApplyData='selectSparePartApplyData'
+      @searchReset='searchReset'
+    ></spare-part-apply-handle>
   </a-card>
 </template>
 
@@ -171,6 +300,7 @@
 import stocktakingBoundHandle from '@views/flowable/workflow/stocktakingBound/stocktakingBoundHandle.vue'
 import lossBoundHandle from '@views/flowable/workflow/lossBound/lossBoundHandle.vue'
 import InboundOrderHandle from '@views/flowable/workflow/inboundOrder/InboundOrderHandle.vue'
+import SparePartApplyHandle from '@views/flowable/workflow/sparePartApply/SparePartApplyHandle.vue'
 
 export default {
   name: 'NcDeviceCharactersList',
@@ -194,7 +324,8 @@
     EquipmentSealUpApprovalModal,
     InboundOrderHandle,
     EquipmentTransferApprovalModal,
-    EquipmentScrapApprovalModal
+    EquipmentScrapApprovalModal,
+    SparePartApplyHandle
   },
   data() {
     return {
@@ -207,7 +338,7 @@
           key: 'rowIndex',
           width: 60,
           align: 'center',
-          customRender: function(t, r, index) {
+          customRender: function (t, r, index) {
             return parseInt(index) + 1
           }
         },
@@ -280,6 +411,7 @@
       selectLossBoundOrderData: {},
       selectStocktakingBoundOrderData: {},
       selectInboundOrderData: {},
+      selectSparePartApplyData: {},
       //涓氬姟淇℃伅ID
       dataId: undefined
     }
@@ -287,7 +419,7 @@
   created() {
   },
   computed: {
-    importExcelUrl: function() {
+    importExcelUrl: function () {
       return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
     },
     getTableColumnsTotalWidth() {
@@ -380,6 +512,9 @@
           break
         case 'equipment_scrap':
           this.handleEquipmentScrap(item)
+          break
+        case 'spare_part_apply':
+          this.handleSparePartApplyApproval(item)
           break
         default:
           alert('娌℃壘鍒拌娴佺▼')
@@ -536,7 +671,15 @@
       this.$refs.equipmentScrapApprovalModelRef.title = item.name
       this.$refs.equipmentScrapApprovalModelRef.handleDetail(item)
       this.$refs.equipmentScrapApprovalModelRef.disableSubmit = false
-    }
+    },
+    handleSparePartApplyApproval(item) {
+      if (item && item.dataId) {
+        this.selectSparePartApplyData = Object.assign({}, item)
+        this.$refs.sparePartApplyModal.auditVisible = true
+        this.$refs.sparePartApplyModal.clearTableSource()
+        this.$refs.sparePartApplyModal.getAllApproveData(item)
+      }
+    },
   }
 }
 </script>
diff --git a/src/views/flowable/workflow/sparePartApply/SparePartApplyHandle.vue b/src/views/flowable/workflow/sparePartApply/SparePartApplyHandle.vue
new file mode 100644
index 0000000..beb8f40
--- /dev/null
+++ b/src/views/flowable/workflow/sparePartApply/SparePartApplyHandle.vue
@@ -0,0 +1,503 @@
+<!--
+ Description: 宸ヤ綔娴�-鍑哄簱鐢宠鍗曞鎵瑰鐞嗛〉闈� List
+ Author: 浣滆�� liuyh
+ Date:   2025-02-27
+-->
+<template>
+  <a-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    :footer="null"
+    @cancel="handCancel"
+  >
+    <a-card :bordered="false">
+      <div>
+        <b>{{ selectSparePartApplyData.description }}</b>
+        <br>
+        <br>
+        <a-tag color="blue">
+          澶勭悊浜� {{ selectSparePartApplyData.assignee_dictText }}
+        </a-tag>
+        <a-tag color="blue">
+          鍒涘缓鏃堕棿 {{ selectSparePartApplyData.createTime }}
+        </a-tag>
+        <br>
+        <br>
+        <button
+          @click="fetchAndShowBmp"
+          class="btn-custom"
+        >鎵撳紑娴佺▼鍥�</button>
+        <div v-if="imageSrc">
+          <img
+            :src="imageSrc"
+            alt="Fetched Image"
+          />
+        </div>
+        <hr class="shallow-hr">
+      </div>
+      <div>
+        <b>鐢宠璇︽儏</b>
+        <br>
+        <a-form :form='form'>
+          <a-spin :spinning="spinning">
+            <a-tabs
+              default-active-key='1'
+              @change='callback'
+            >
+              <a-tab-pane
+                key='2'
+                tab='鐢宠鏄庣粏淇℃伅'
+              >
+                <a-row>
+                  <a-col :span='span'>
+                    <a-form-model-item
+                      label='澶囦欢璇疯喘鍗曠紪鍙�'
+                      :labelCol='labelCol'
+                      :wrapperCol='wrapperCol'
+                      prop='requisitionCode'
+                    >
+                      <a-input
+                        :disabled='coldisabled'
+                        v-model='tableRowRecord.requisitionCode'
+                      ></a-input>
+                    </a-form-model-item>
+                  </a-col>
+                </a-row>
+                <a-table
+                  ref="table"
+                  size="middle"
+                  bordered
+                  rowKey="id"
+                  :scroll="{x:'max-content'}"
+                  :columns="columns"
+                  :dataSource="dataSource"
+                  :pagination="ipagination"
+                  :loading="loading"
+                  :rowSelection="null"
+                >
+                </a-table>
+              </a-tab-pane>
+              <a-tab-pane
+                key='3'
+                tab='娴佺▼鑺傜偣'
+              >
+                <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-tab-pane>
+            </a-tabs>
+          </a-spin>
+        </a-form>
+      </div>
+      <div v-if="auditVisible">
+        <hr class="shallow-hr">
+        <br>
+        <b>瀹℃壒璇︽儏</b>
+        <br>
+        <a-form-model
+          ref="form"
+          :model="approveData"
+          :rules="validatorRules"
+          slot="detail"
+        >
+          <a-row>
+            <a-col ::span='span'>
+              <a-form-model-item
+                label="鐢宠浜�"
+                :labelCol="labelCol"
+                :wrapperCol="wrapperCol"
+                prop='reportUser'
+              >
+                <a-input
+                  :disabled='coldisabled'
+                  v-model='tableRowRecord.reportUser'
+                ></a-input>
+              </a-form-model-item>
+            </a-col>
+            <a-col ::span='span'>
+              <a-form-model-item
+                label="鐢宠鏃堕棿"
+                :labelCol="labelCol"
+                :wrapperCol="wrapperCol"
+                prop="createTime"
+              >
+                <a-input
+                  :disabled='coldisabled'
+                  v-model='tableRowRecord.createTime'
+                ></a-input>
+              </a-form-model-item>
+            </a-col>
+            <a-col
+              :span="24"
+              class="btxx"
+            >
+              <a-form-item
+                label="瀹℃壒鐘舵��"
+                :labelCol="labelCol"
+                :wrapperCol="wrapperCol"
+              >
+                <a-select
+                  v-model='assignFileStream.status'
+                  placeholder="璇烽�夋嫨瀹℃壒缁撴灉"
+                >
+                  <a-select-option value="1">閫氳繃</a-select-option>
+                  <a-select-option value="2">椹冲洖</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col
+              :span="24"
+              class="btxx"
+            >
+              <a-form-model-item
+                label="瀹℃壒鎰忚"
+                :labelCol="labelCol"
+                :wrapperCol="wrapperCol"
+              >
+                <a-textarea
+                  v-model="assignFileStream.approvalOpinion"
+                  rows="4"
+                  placeholder="璇疯緭鍏ュ鎵规剰瑙�"
+                />
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <div
+            class="table-operator"
+            style="text-align: right;"
+          >
+            <a-button
+              @click="handleQueXiaoTask"
+              type="primary"
+              icon="close"
+            >鍙栨秷</a-button>
+            <a-button @click="submitForm">鎻愪氦</a-button>
+          </div>
+        </a-form-model>
+      </div>
+    </a-card>
+
+  </a-modal>
+</template>
+
+<script>
+
+import '@assets/less/TableExpand.less'
+import { mixinDevice } from '@/utils/mixin'
+import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage'
+export default {
+  name: 'FlowShenPi',
+  mixins: [mixinDevice],
+  props: {
+    selectSparePartApplyData: {
+      type: Object,
+      required: true
+    }
+  },
+
+  data() {
+    return {
+      form: this.$form.createForm(this),
+      span: 12,
+      span1: 8,
+      coldisabled: true,
+      spinning: false,
+      tableRowRecord: {},
+      assignFileStream: {},
+      tableDataSource: [],
+      usageDataSource: [],
+      hitaskDataSource: [],
+      dataSource: [],
+      bomForm: {},
+      imageSrc: null,
+      drawerVisible: true,
+      auditVisible: true,
+      loading: false,
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 }
+      },
+      wrapperCol: {
+        xs: { span: 30 },
+        sm: { span: 16 }
+      },
+      /* 鍒嗛〉鍙傛暟 */
+      ipagination: {
+        current: 1,
+        pageSize: 5,
+        pageSizeOptions: ['5', '10', '50'],
+        showTotal: (total, range) => {
+          return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�"
+        },
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0
+      },
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: "center",
+          customRender: function (t, r, index) {
+            return parseInt(index) + 1;
+          }
+        },
+        {
+          title: '澶囦欢鍒嗙被',
+          align: "left",
+          dataIndex: 'partCategory'
+        },
+        {
+          title: '澶囦欢缂栫爜',
+          align: "left",
+          dataIndex: 'partCode'
+        },
+        {
+          title: '澶囦欢鍚嶇О',
+          align: "center",
+          dataIndex: 'partName'
+        },
+        {
+          title: '澶囦欢瑙勬牸',
+          align: "center",
+          dataIndex: 'partModel'
+        },
+        {
+          title: '鍨嬪彿',
+          align: "center",
+          dataIndex: 'partSpecification'
+        },
+
+        {
+          title: '鐢宠鏁伴噺',
+          align: "center",
+          dataIndex: 'quantity'
+        },
+      ],
+      validatorRules: {
+        status: {
+          rules: [
+            { required: true, message: '璇烽�夋嫨瀹℃壒鐘舵��!' },
+          ]
+        },
+      },
+      approveData: {},
+      flowData: {},
+      title: '瀹℃壒椤甸潰',
+      width: 1200,
+      visible: false,
+      // 琛ㄥご
+      url: {
+        getSparePartRequisitionList: '/eam/eamSparePartRequisition/getSparePartRequisitionList',
+        diagramView: '/assign/flow/diagramView',
+        queryHisTaskList: '/assign/flow/queryHisTaskList',
+        approve: "/eam/eamSparePartRequisition/approval",
+      },
+      dictOptions: {},
+      superFieldList: [],
+      workflowSource: []
+    }
+  },
+  created() {
+  },
+  computed: {},
+  methods: {
+    callback() {
+    },
+    handCancel() {
+      this.assignFileStream = {}
+      this.visible = false
+    },
+    clearTableSource() {
+      this.tableDataSource = []
+      this.usageDataSource = []
+    },
+    fetchAndShowBmp() {
+      console.log('flowData----->', this.flowData)
+      try {
+        let parm = {
+          processDefinitionId: this.flowData.processDefinitionId,
+          processInstanceId: this.flowData.processInstanceId,
+          TaskDefinitionKey: this.flowData.processDefinitionKey
+        }
+        downFile(this.url.diagramView, parm, 'get').then((res => {
+          console.log('Pica------>', res)
+          const urlObject = window.URL.createObjectURL(new Blob([res]))
+          this.imageSrc = urlObject
+        }))
+      } catch (error) {
+        console.error('Error fetching image blob:', error)
+        alert('鏃犳硶鍔犺浇鍥剧墖锛岃绋嶅悗鍐嶈瘯銆�')
+      }
+    },
+    handleQueXiaoTask() {
+      this.visible = false
+      this.routeReload()
+    },
+    submitForm() {
+      const that = this;
+      if (!that.assignFileStream.status == null || that.assignFileStream.status === undefined) {
+        this.$message.warning('璇烽�夋嫨瀹℃壒鐘舵�侊紒')
+        return false;
+      }
+      if (!that.assignFileStream.approvalOpinion == null || that.assignFileStream.approvalOpinion === undefined) {
+        this.$message.warning('璇疯緭鍏ュ鎵规剰瑙侊紒')
+        return false;
+      }
+      // 瑙﹀彂琛ㄥ崟楠岃瘉
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          that.confirmLoading = true;
+          let url = this.url.approve
+          let method = 'post';
+          let EamSparePartRequisitionRequest = {}
+          EamSparePartRequisitionRequest.id = this.flowData.dataId
+          EamSparePartRequisitionRequest.status = that.assignFileStream.status;
+          EamSparePartRequisitionRequest.approvalOpinion = that.assignFileStream.approvalOpinion;
+          EamSparePartRequisitionRequest.comment = that.assignFileStream.approvalOpinion;
+          EamSparePartRequisitionRequest.dataId = this.selectSparePartApplyData.dataId
+          EamSparePartRequisitionRequest.taskId = this.selectSparePartApplyData.id
+          EamSparePartRequisitionRequest.userId = this.selectSparePartApplyData.assignee
+          EamSparePartRequisitionRequest.instanceId = this.selectSparePartApplyData.procInstId
+          EamSparePartRequisitionRequest.targetKey = this.selectSparePartApplyData.taskDefKey
+          EamSparePartRequisitionRequest.values = this.selectSparePartApplyData.variables
+          EamSparePartRequisitionRequest.assignee = this.selectSparePartApplyData.assignee
+          httpAction(url, EamSparePartRequisitionRequest, method).then((res) => {
+            if (res.success) {
+              that.$message.success(res.message);
+              this.handCancel()
+              //鍒锋柊琛ㄦ牸
+              that.$emit('searchReset')
+            } else {
+              that.$message.warning(res.message);
+            }
+          }).finally(() => {
+            that.confirmLoading = false;
+          })
+        }
+
+      })
+    },
+
+
+    getAllApproveData(item) {
+      this.tableRowRecord = {}
+      this.assignFileStream = {}
+      this.visible = true
+      this.loading = true
+      console.log('selectSparePartApplyData----->', this.selectSparePartApplyData)
+      this.flowData = item
+      getAction(this.url.queryHisTaskList, { procInstId: item.procInstId }).then(res => {
+        if (res.success) {
+          this.hitaskDataSource = res.result
+        }
+      })
+      getAction(this.url.getSparePartRequisitionList, { id: item.dataId }).then(res => {
+        if (res.success) {
+          this.tableRowRecord.requisitionCode = res.result.records[0].requisitionCode
+          this.tableRowRecord.reportUser = res.result.records[0].reportUser
+          this.tableRowRecord.createTime = res.result.records[0].createTime
+          this.dataSource = res.result.records[0].sparePartRequisitionDetailList
+          if (res.result.total) {
+            this.ipagination.total = res.result.total
+          } else {
+            this.ipagination.total = 0
+          }
+        } else {
+          this.$message.warning(res.message)
+        }
+      }).finally(() => {
+        this.loading = false
+      })
+    }
+  }
+}
+</script>
+<style scoped>
+.shallow-hr {
+  border: 0;
+  height: 1px; /* 鍒嗙晫绾跨殑楂樺害 */
+  background-color: rgba(0, 0, 0, 0.1); /* 浣跨敤 RGBA 棰滆壊锛屽苟璁剧疆杈冧綆鐨勯�忔槑搴� */
+  margin: 20px 0; /* 鍒嗙晫绾夸笂涓嬬殑澶栬竟璺� */
+}
+.btn-custom {
+  background-color: #4caf50; /* 缁胯壊鑳屾櫙 */
+  color: white; /* 鐧借壊鏂囧瓧 */
+  border: none; /* 鏃犺竟妗� */
+  padding: 5px 15px; /* 鍐呰竟璺� */
+  text-align: center; /* 鏂囧瓧灞呬腑 */
+  text-decoration: none; /* 鏃犱笅鍒掔嚎 */
+  display: inline-block; /* 琛屽唴鍧楀厓绱� */
+  font-size: 12px; /* 瀛椾綋澶у皬 */
+  margin: 4px 2px; /* 澶栬竟璺� */
+  cursor: pointer; /* 榧犳爣鎮仠鏃舵樉绀烘墜鍨� */
+  border-radius: 4px; /* 鍦嗚杈规 */
+}
+
+.bold-large-label {
+  font-weight: bold;
+  font-size: 20px; /* 鎴栦綘闇�瑕佺殑浠讳綍澶у皬 */
+}
+.left_qiu {
+  position: absolute;
+  left: -74px;
+  top: 0;
+  width: 54px;
+  border-radius: 50%;
+  height: 54px;
+  font-size: 13px;
+  margin: auto;
+  display: flex;
+  flex-wrap: wrap;
+  align-items: center;
+  justify-content: center;
+  background: #0099ff;
+  transform: translate(0, 0);
+}
+/deep/ .ant-timeline-item-tail {
+  left: -29px !important;
+}
+.left_qiu span {
+  width: 3em;
+  display: block;
+  color: #fff;
+  text-align: center;
+}
+.img {
+  width: 75%;
+}
+
+.wrap {
+  clear: both;
+  width: 100%;
+  display: flex;
+  height: 50px;
+  border: 1px solid #ccc;
+  /* background-color: aqua; */
+}
+.box {
+  width: 21%;
+  height: 50px;
+  border-right: 1px solid #ccc;
+  line-height: 50px;
+  /* background: red; */
+  text-align: center;
+  margin: auto;
+}
+
+@import '~@assets/less/common.less';
+</style>
\ No newline at end of file

--
Gitblit v1.9.3