Переглянути джерело

fix: 委托管理 详情 禁止编辑

32197351@qq.com 2 роки тому
батько
коміт
9d10cf4925

+ 2 - 2
itdmWeb/src/views/module-iTDM/weituo/modules/ItdmWeituoInfoForm.vue

@@ -8,8 +8,8 @@
       <a-step title="填写试验信息" />
     </a-steps>
     <div class="content">
-      <step1 v-if="currentTab === 0" ref="data001" @nextStep="nextStep" />
-      <step2 v-if="currentTab === 1" @prevStep="prevStep" @nextStep="nextStep" />
+      <step1 v-if="currentTab === 0" ref="data001" @nextStep="nextStep"   :disabled="disabled"/>
+      <step2 v-if="currentTab === 1" @prevStep="prevStep" @nextStep="nextStep"  :disabled="disabled" />
       <step3 v-if="currentTab === 2" @submitForm="submitForm" @prevStep="prevStep" :disabled="disabled" />
     </div>
   </a-card>

+ 22 - 8
itdmWeb/src/views/module-iTDM/weituo/modules/step/Step1.vue

@@ -5,32 +5,32 @@
     <a-row>
       <a-col :span="24">
         <a-form-model-item label="委托单位名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="weituoClient">
-          <a-input v-model="model.weituoClient" placeholder="请输入委托单位名称"></a-input>
+          <a-input v-model="model.weituoClient" placeholder="请输入委托单位名称" :disabled="formDisabled"></a-input>
         </a-form-model-item>
       </a-col>
       <a-col :span="24">
         <a-form-model-item label="委托单位地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="weituoAddress">
-          <a-input v-model="model.weituoAddress" placeholder="请输入委托单位地址"></a-input>
+          <a-input v-model="model.weituoAddress" placeholder="请输入委托单位地址" :disabled="formDisabled"></a-input>
         </a-form-model-item>
       </a-col>
       <a-col :span="24">
         <a-form-model-item label="委托联系人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="weituoLxr">
-          <a-input v-model="model.weituoLxr" placeholder="请输入委托联系人"></a-input>
+          <a-input v-model="model.weituoLxr" placeholder="请输入委托联系人" :disabled="formDisabled"></a-input>
         </a-form-model-item>
       </a-col>
       <a-col :span="24">
         <a-form-model-item label="委托电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="weituoPhone">
-          <a-input v-model="model.weituoPhone" placeholder="请输入委托电话"></a-input>
+          <a-input v-model="model.weituoPhone" placeholder="请输入委托电话" :disabled="formDisabled" ></a-input>
         </a-form-model-item>
       </a-col>
       <a-col :span="24">
         <a-form-model-item label="委托邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="weituoEmail">
-          <a-input v-model="model.weituoEmail" placeholder="请输入委托邮箱"></a-input>
+          <a-input v-model="model.weituoEmail" placeholder="请输入委托邮箱" :disabled="formDisabled" ></a-input>
         </a-form-model-item>
       </a-col>
       <a-col :span="24">
         <a-form-model-item label="报告用章" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bgyz">
-          <j-dict-select-tag v-model="model.bgyz" placeholder="请选择报告形式"
+          <j-dict-select-tag v-model="model.bgyz" placeholder="请选择报告形式" :disabled="formDisabled"
                              dictCode="weituo.bgyz" />
         </a-form-model-item>
       </a-col>
@@ -38,14 +38,14 @@
         <a-form-model-item label="报告形式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bgxs">
 
 
-          <j-dict-select-tag v-model="model.bgxs" placeholder="请选择报告形式"
+          <j-dict-select-tag v-model="model.bgxs" placeholder="请选择报告形式" :disabled="formDisabled"
                              dictCode="weituo.bgxs" />
 
         </a-form-model-item>
       </a-col>
       <a-col :span="24">
         <a-form-model-item label="特殊要求" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="teshuyaoqiu">
-          <a-textarea v-model="model.teshuyaoqiu" placeholder="请输入特殊要求"></a-textarea>
+          <a-textarea v-model="model.teshuyaoqiu" placeholder="请输入特殊要求" :disabled="formDisabled"></a-textarea>
         </a-form-model-item>
       </a-col>
 
@@ -61,6 +61,7 @@
     </a-form-item>
   </a-form-model>
 
+
 </template>
 
 <script>
@@ -70,6 +71,14 @@ import { validateDuplicateValue } from '@/utils/util'
 
 export default {
   name: 'step1',
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false
+    }
+  },
   components: {},
   data() {
     return {
@@ -115,6 +124,11 @@ export default {
   created() {
 
   },
+  computed: {
+    formDisabled(){
+      return this.disabled
+    },
+  },
 
   methods: {
 

+ 16 - 5
itdmWeb/src/views/module-iTDM/weituo/modules/step/Step2.vue

@@ -1,5 +1,4 @@
 <template>
-
   <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
     <a-table
       :columns="columns"
@@ -10,6 +9,7 @@
         v-for="(col, i) in ['sampleName', 'sampleModelSpecification', 'sampleQuantities','sampleManufacturer']"
         :slot="col" slot-scope="text, record, index">
         <a-input
+          :disabled="formDisabled"
           :key="col"
           style="margin: -5px 0"
           :value="text"
@@ -23,13 +23,13 @@
       <template slot="operation" slot-scope="text, record, index">
           <span>
               <a-divider type="vertical" />
-              <a-popconfirm title="是否要删除此行?" @confirm="remove(record.key)">
+              <a-popconfirm title="是否要删除此行?" :disabled="formDisabled"  @confirm="remove(record.key)">
                 <a>删除</a>
               </a-popconfirm>
             </span>
       </template>
     </a-table>
-    <a-button style="width: 100%; margin-top: 16px; margin-bottom: 8px" type="dashed" icon="plus" @click="newMember">
+    <a-button style="width: 100%; margin-top: 16px; margin-bottom: 8px" type="dashed" :disabled="formDisabled" icon="plus" @click="newMember">
       新增成员
     </a-button>
 
@@ -50,8 +50,14 @@
 
 export default {
   name: 'step2',
-
-  props: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false
+    }
+  },
   data() {
     return {
       count: 1,
@@ -112,6 +118,11 @@ export default {
       data: []
     }
   },
+  computed: {
+    formDisabled(){
+      return this.disabled
+    },
+  },
   created() {
     const data = JSON.parse(sessionStorage.getItem('yangpin'))
     if (data != null) {

+ 87 - 81
itdmWeb/src/views/module-iTDM/weituo/modules/step/Step3.vue

@@ -1,92 +1,96 @@
 <template>
-
-  <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
-    <a-table
-      :columns="columns"
-      :dataSource="data"
-      :pagination="false"
-    >
-
-
-      <template v-for="(col, i) in ['yangpinKeyId', 'testItems', 'standardRequirement','judgementBasis','beizhu']"
-                :slot="col" slot-scope="text, record, index">
-
-
-        <a-select
-          :key="col"
-          v-if="record.editable && col==='yangpinKeyId'"
-          style="margin: -5px 0"
-          :value="text"
-          :placeholder="columns[i].title"
-
-          @change="e => handleChange(e, record.key, col)">
-
-          <a-select-option v-for="d in yangpins" :key="d.key">
-            {{ d.sampleName }}
-          </a-select-option>
-        </a-select>
-
-
-        <a-input
-          :key="col"
-          v-if="record.editable && col==='testItems'"
-          style="margin: -5px 0"
-          :value="text"
-          :placeholder="columns[i].title"
-          @change="e => handleChange(e.target.value, record.key, col)"></a-input>
-
-
-        <j-search-select-tag
-          :key="col"
-          v-if="record.editable && col==='standardRequirement'"
-          style="margin: -5px 0"
-          :value="text"
-          :placeholder="columns[i].title" @change="e=>handleChange(e, record.key, col)"
-          dict="itdm_weituo_yiju,name,name" />
-
-        <a-input
-          :key="col"
-          v-if="record.editable && col==='judgementBasis'"
-          style="margin: -5px 0"
-          :value="text"
-          :placeholder="columns[i].title"
-          @change="e => handleChange(e.target.value, record.key, col)"></a-input>
-
-
-        <a-input
-          :key="col"
-          v-if="record.editable && col==='beizhu'"
-          style="margin: -5px 0"
-          :value="text"
-          :placeholder="columns[i].title"
-          @change="e => handleChange(e.target.value, record.key, col)"></a-input>
-
-
-      </template>
-
-      <template slot="operation" slot-scope="text, record, index">
+    <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+      <a-table
+        :columns="columns"
+        :dataSource="data"
+        :pagination="false"
+      >
+
+
+        <template v-for="(col, i) in ['yangpinKeyId', 'testItems', 'standardRequirement','judgementBasis','beizhu']"
+                  :slot="col" slot-scope="text, record, index">
+
+
+          <a-select
+            :disabled="formDisabled"
+            :key="col"
+            v-if="record.editable && col==='yangpinKeyId'"
+            style="margin: -5px 0"
+            :value="text"
+            :placeholder="columns[i].title"
+
+            @change="e => handleChange(e, record.key, col)">
+
+            <a-select-option v-for="d in yangpins" :key="d.key">
+              {{ d.sampleName }}
+            </a-select-option>
+          </a-select>
+
+
+          <a-input
+            :disabled="formDisabled"
+            :key="col"
+            v-if="record.editable && col==='testItems'"
+            style="margin: -5px 0"
+            :value="text"
+            :placeholder="columns[i].title"
+            @change="e => handleChange(e.target.value, record.key, col)"></a-input>
+
+
+          <j-search-select-tag
+            :disabled="formDisabled"
+            :key="col"
+            v-if="record.editable && col==='standardRequirement'"
+            style="margin: -5px 0"
+            :value="text"
+            :placeholder="columns[i].title" @change="e=>handleChange(e, record.key, col)"
+            dict="itdm_weituo_yiju,name,name" />
+
+          <a-input
+            :disabled="formDisabled"
+            :key="col"
+            v-if="record.editable && col==='judgementBasis'"
+            style="margin: -5px 0"
+            :value="text"
+            :placeholder="columns[i].title"
+            @change="e => handleChange(e.target.value, record.key, col)"></a-input>
+
+
+          <a-input
+            :disabled="formDisabled"
+            :key="col"
+            v-if="record.editable && col==='beizhu'"
+            style="margin: -5px 0"
+            :value="text"
+            :placeholder="columns[i].title"
+            @change="e => handleChange(e.target.value, record.key, col)"></a-input>
+
+
+        </template>
+
+        <template slot="operation" slot-scope="text, record, index">
           <span>
               <a-divider type="vertical" />
-              <a-popconfirm title="是否要删除此行?" @confirm="remove(record.key)">
+              <a-popconfirm  :disabled="formDisabled" title="是否要删除此行?" @confirm="remove(record.key)">
                 <a>删除</a>
               </a-popconfirm>
             </span>
-      </template>
+        </template>
 
 
-    </a-table>
-    <a-button style="width: 100%; margin-top: 16px; margin-bottom: 8px" type="dashed" icon="plus" @click="newMember">
-      新增成员
-    </a-button>
+      </a-table>
+      <a-button :disabled="formDisabled" style="width: 100%; margin-top: 16px; margin-bottom: 8px" type="dashed" icon="plus" @click="newMember">
+        新增成员
+      </a-button>
 
 
-    <a-form-item :wrapperCol="{span: 19, offset: 5}">
-      <a-button style="margin-left: 8px" @click="prevStep">上一步</a-button>
-      <a-button v-if="!disabled" style="margin-left: 8px" @click="submitForm">提交</a-button>
+      <a-form-item :wrapperCol="{span: 19, offset: 5}">
+        <a-button style="margin-left: 8px" @click="prevStep">上一步</a-button>
+        <a-button v-if="!disabled" style="margin-left: 8px" @click="submitForm">提交</a-button>
 
 
-    </a-form-item>
-  </a-form-model>
+      </a-form-item>
+    </a-form-model>
 
 
 </template>
@@ -159,12 +163,16 @@ export default {
       data: []
     }
   },
-
+  computed: {
+    formDisabled() {
+      return this.disabled
+    }
+  },
   created() {
     const data = JSON.parse(sessionStorage.getItem('yangpinkz'))
 
     if (data != null) {
-      for (let  xx of data) {
+      for (let xx of data) {
         this.data.push({
           key: xx.key,
           yangpinKeyId: xx.yangpinKeyId,
@@ -187,7 +195,6 @@ export default {
 
     this.count = sessionStorage.getItem('count1') != null ? Number(sessionStorage.getItem('count1')) : 1
 
-
   },
   methods: {
 
@@ -229,7 +236,6 @@ export default {
     submitForm() {
       sessionStorage.setItem('yangpinkz', JSON.stringify(this.data))
 
-
       // this.$refs.form.validate(valid => {
       //   if (valid) {
       this.$emit('submitForm')