From 352780a799d49510eb75b48e75015e8528612fec Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期三, 23 七月 2025 15:45:21 +0800
Subject: [PATCH] 1、停用申请页面功能及流程 2、调整技术状态变更申请驳回时的审批节点展示条件

---
 src/views/eam/technical/modules/EamTechnicalStatusDeactivateModal.vue |  329 +++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 225 insertions(+), 104 deletions(-)

diff --git a/src/views/eam/technical/modules/EamTechnicalStatusDeactivateModal.vue b/src/views/eam/technical/modules/EamTechnicalStatusDeactivateModal.vue
index ca3e5d4..ffce398 100644
--- a/src/views/eam/technical/modules/EamTechnicalStatusDeactivateModal.vue
+++ b/src/views/eam/technical/modules/EamTechnicalStatusDeactivateModal.vue
@@ -1,147 +1,268 @@
 <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="deactivateOrderNum" label="鍋滅敤鍗曞彿">
-          <a-input placeholder="璇疯緭鍏ュ仠鐢ㄥ崟鍙�" v-model="model.deactivateOrderNum" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicant" label="鐢宠浜�">
-          <a-input placeholder="璇疯緭鍏ョ敵璇蜂汉" v-model="model.applicant" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryOrgCode" label="鐢宠閮ㄩ棬">
-          <a-input placeholder="璇疯緭鍏ョ敵璇烽儴闂�" v-model="model.factoryOrgCode" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applyDate" label="鐢宠鏃ユ湡">
-          <a-input placeholder="璇疯緭鍏ョ敵璇锋棩鏈�" v-model="model.applyDate" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicationStatus" label="鐢宠鍗曠姸鎬�;寰呮彁浜ゃ�佸緟鍗曚綅瀹ょ骇棰嗗瀹℃牳銆佺敓浜ц澶囩鐞嗕富绠″鏍搞�佸緟淇濋殰閮ㄩ瀵煎鏍搞�佸凡浣滃簾銆佸凡瀹屾垚">
-          <a-input placeholder="璇疯緭鍏ョ敵璇峰崟鐘舵��;寰呮彁浜ゃ�佸緟鍗曚綅瀹ょ骇棰嗗瀹℃牳銆佺敓浜ц澶囩鐞嗕富绠″鏍搞�佸緟淇濋殰閮ㄩ瀵煎鏍搞�佸凡浣滃簾銆佸凡瀹屾垚" v-model="model.applicationStatus" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departHeaderSignature" label="浣跨敤鍗曚綅瀹や富绠$瀛�">
-          <a-input placeholder="璇疯緭鍏ヤ娇鐢ㄥ崟浣嶅涓荤绛惧瓧" v-model="model.departHeaderSignature" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departHeaderSignatureTime" label="浣跨敤鍗曚綅瀹や富绠$瀛楁椂闂�">
-          <a-input placeholder="璇疯緭鍏ヤ娇鐢ㄥ崟浣嶅涓荤绛惧瓧鏃堕棿" v-model="model.departHeaderSignatureTime" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departHeaderSignatureComment" label="浣跨敤鍗曚綅瀹や富绠℃剰瑙�">
-          <a-input placeholder="璇疯緭鍏ヤ娇鐢ㄥ崟浣嶅涓荤鎰忚" v-model="model.departHeaderSignatureComment" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departLeaderSignature" label="浣跨敤鍗曚綅閮ㄤ富绠$瀛�">
-          <a-input placeholder="璇疯緭鍏ヤ娇鐢ㄥ崟浣嶉儴涓荤绛惧瓧" v-model="model.departLeaderSignature" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departLeaderSignatureTime" label="浣跨敤鍗曚綅閮ㄤ富绠$瀛楁椂闂�">
-          <a-input placeholder="璇疯緭鍏ヤ娇鐢ㄥ崟浣嶉儴涓荤绛惧瓧鏃堕棿" v-model="model.departLeaderSignatureTime" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departLeaderSignatureComment" label="浣跨敤鍗曚綅閮ㄤ富绠$瀛�">
-          <a-input placeholder="璇疯緭鍏ヤ娇鐢ㄥ崟浣嶉儴涓荤绛惧瓧" v-model="model.departLeaderSignatureComment" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hfCode" label="HF缂栫爜">
-          <a-input placeholder="璇疯緭鍏F缂栫爜" v-model="model.hfCode" />
-        </a-form-model-item>
-		
+  <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>
+          <a-col :span="8">
+            <a-form-model-item label="鍋滅敤鍗曞彿">
+              <a-input placeholder="绯荤粺鑷姩鐢熸垚" v-model="model.deactivateOrderNum" disabled/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="鐢宠閮ㄩ棬" prop="factoryOrgCode">
+              <a-tree-select v-model="model.factoryOrgCode" :tree-data="productionTreeData"
+                             @change="detail.dataSource=[]"
+                             show-search :replaceFields="{key:'orgCode',value:'orgCode'}"
+                             treeNodeFilterProp="title" searchPlaceholder="璇疯緭鍏ュ叧閿瓧鎼滅储"
+                             :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" placeholder="璇烽�夋嫨鐢宠閮ㄩ棬"
+                             allow-clear tree-default-expand-all :allow-clear="false"/>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="澶囨敞" :labelCol="{span:2}" :wrapperCol="{span:20}">
+              <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.remark"/>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
       </a-form-model>
+
+      <j-vxe-table ref="editableDetailTable" rowNumber rowSelection bordered alwaysEdit toolbar
+                   v-if="model.factoryOrgCode"
+                   :toolbarConfig="detail.toolbarConfig" keep-source :height="300"
+                   :dataSource="detail.dataSource" :columns="detail.columns">
+        <!--缁熶竴缂栫爜-->
+        <template v-slot:equipmentId="props">
+          <lx-search-equipment-select v-model="props.row.equipmentId" placeholder="璇疯緭鍏ョ粺涓�缂栫爜鎴栧悕绉版悳绱�"
+                                      :factoryOrgCode="model.factoryOrgCode"
+                                      @autocompleteForm="autocompleteForm($event,props.row)" :allowClear="false"/>
+        </template>
+
+        <!-- 淇濆吇鏃ユ湡-->
+        <template v-slot:changeDate="props">
+          <a-date-picker v-model="props.row.changeDate" value-format="YYYY-MM-DD" :allow-clear="false"/>
+        </template>
+
+        <!-- 鎿嶄綔-->
+        <template v-slot:action="props">
+          <a :disabled="!props.row.equipmentId" @click="handlePreviewDetail(props.row.standardId)">棰勮鏄庣粏</a>
+        </template>
+      </j-vxe-table>
     </a-spin>
   </j-modal>
 </template>
 
 <script>
-  import { httpAction } from '@/api/manage'
-  import moment from "moment"
+  import { httpAction, getAction } from '@/api/manage'
+  import { JVXETypes } from '@comp/jeecg/JVxeTable'
+  import LxSearchEquipmentSelect from '../../equipment/modules/LxSearchEquipmentSelect'
 
   export default {
-    name: "EamTechnicalStatusDeactivateModal",
-    data () {
+    name: 'EamTechnicalStatusDeactivateModal',
+    components: { LxSearchEquipmentSelect },
+    props: {
+      productionTreeData: {
+        type: Array
+      }
+    },
+    data() {
       return {
-        title:"鎿嶄綔",
+        title: '鎿嶄綔',
         visible: false,
+        spinning: false,
         model: {},
         labelCol: {
           xs: { span: 24 },
-          sm: { span: 5 },
+          sm: { span: 6 }
         },
         wrapperCol: {
           xs: { span: 24 },
-          sm: { span: 16 },
+          sm: { span: 18 }
         },
-
         confirmLoading: false,
-        validatorRules:{
+        validatorRules: {
+          factoryOrgCode: [{ required: true, message: '璇烽�夋嫨鐢宠閮ㄩ棬', trigger: 'change' }]
+        },
+        detail: {
+          dataSource: [],
+          columns: [
+            {
+              title: 'ID',
+              key: 'id',
+              type: JVXETypes.hidden
+            },
+            {
+              title: '缁熶竴缂栫爜',
+              key: 'equipmentId',
+              align: 'center',
+              type: JVXETypes.slot,
+              slotName: 'equipmentId',
+              width: 250,
+              validateRules: [
+                { required: true, message: '璇疯緭鍏�${title}鎴栧悕绉版悳绱�' },
+                { unique: true, message: '${title}涓嶈兘閲嶅' }
+              ]
+            },
+            {
+              title: '璁惧鍚嶇О',
+              key: 'equipmentName',
+              align: 'center',
+              type: JVXETypes.normal,
+              width: 200
+            },
+            {
+              title: '璁惧鍨嬪彿',
+              key: 'equipmentModel',
+              align: 'center',
+              type: JVXETypes.normal,
+              width: 200
+            },
+            {
+              title: '浣跨敤鍗曚綅',
+              key: 'factoryName',
+              align: 'center',
+              type: JVXETypes.normal,
+              width: 200
+            },
+            {
+              title: '鍋滅敤鍘熷洜',
+              key: 'deactivateReason',
+              align: 'center',
+              type: JVXETypes.textarea,
+              width: 200,
+              placeholder: '璇疯緭鍏�${title}',
+              validateRules: [{ required: true, message: '璇疯緭鍏�${title}' }]
+            },
+            {
+              title: '宸插仠鐢ㄦ椂闀�',
+              key: 'deactivateDuration',
+              align: 'center',
+              type: JVXETypes.inputNumber,
+              width: 200,
+              placeholder: '璇疯緭鍏�${title}',
+              validateRules: [{ required: true, message: '璇疯緭鍏�${title}' }]
+            }
+          ],
+          toolbarConfig: {
+            // prefix 鍓嶇紑锛泂uffix 鍚庣紑
+            slot: ['prefix', 'suffix'],
+            // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳
+            btn: ['add', 'remove', 'clearSelection']
+          }
         },
         url: {
-          add: "/eam/eamTechnicalStatusDeactivate/add",
-          edit: "/eam/eamTechnicalStatusDeactivate/edit",
-        },
+          add: '/eam/eamTechnicalStatusDeactivate/add',
+          edit: '/eam/eamTechnicalStatusDeactivate/edit',
+          detail: '/eam/eamTechnicalStatusDeactivateDetail/queryList'
+        }
       }
     },
-    created () {
-    },
     methods: {
-      add () {
+      add() {
         //鍒濆鍖栭粯璁ゅ��
-        this.edit({});
+        this.edit({})
       },
-      edit (record) {
-        this.model = Object.assign({}, record);
-        this.visible = true;
+
+      edit(record) {
+        this.model = Object.assign({}, record)
+        this.visible = true
+        if (this.model.id) this.loadDetail(record.id)
       },
-      close () {
-        this.$emit('close');
-        this.visible = false;
-        this.$refs.form.clearValidate();
+
+      autocompleteForm(selectObj, record) {
+        record.factoryName = selectObj.factoryOrgCode_dictText
+        record.equipmentName = selectObj.equipmentName
+        record.equipmentModel = selectObj.equipmentModel
       },
-      handleOk () {
-        const that = this;
+
+      /**
+       * 鑾峰彇璁惧鏄庣粏
+       * @param applicationId
+       */
+      loadDetail(applicationId) {
+        this.spinning = true
+        this.detail.dataSource = []
+        getAction(this.url.detail, { applicationId })
+          .then(res => {
+            console.log('res', res)
+            if (res.success) this.detail.dataSource = res.result
+          })
+          .finally(() => {
+            this.spinning = false
+          })
+      },
+
+      async handleOk() {
+        const tableData = this.$refs.editableDetailTable.getTableData()
+        if (tableData.length == 0) {
+          this.$notification.warning({
+            message: '娑堟伅',
+            description: '璇疯嚦灏戞柊澧炰竴鏉¤褰�'
+          })
+          return
+        }
+
+        const errMap = await this.$refs.editableDetailTable.validateTable()
+        if (errMap) return
+
+        const that = this
         // 瑙﹀彂琛ㄥ崟楠岃瘉
-         this.$refs.form.validate(valid => {
+        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';
+            that.confirmLoading = that.spinning = 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;
+
+            that.model.tableDetailList = this.$refs.editableDetailTable.getTableData()
+            httpAction(httpUrl, this.model, method)
+              .then((res) => {
+                if (res.success) {
+                  that.$notification.success({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
+                  that.$emit('ok')
+                  that.close()
+                } else {
+                  that.$notification.warning({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
+                }
+              })
+              .finally(() => {
+                that.confirmLoading = that.spinning = false
+              })
+          } else {
+            return false
           }
         })
       },
-      handleCancel () {
+      handleCancel() {
         this.close()
       },
 
-
+      close() {
+        this.$emit('close')
+        this.visible = false
+        if (this.$refs.form) this.$refs.form.clearValidate()
+      }
     }
   }
 </script>
 
 <style lang="less" scoped>
-
+  /deep/ .ant-select-dropdown-menu {
+    text-align: left;
+  }
 </style>
\ No newline at end of file

--
Gitblit v1.9.3