Kaynağa Gözat

保养工单优化

wyh 1 yıl önce
ebeveyn
işleme
bb077052e2

+ 77 - 15
src/views/module_cmms/upkeep/modules/UpkeepForm.vue

@@ -2,17 +2,18 @@
   <a-spin :spinning="confirmLoading">
     <j-form-container :disabled="formDisabled">
       <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <div class="cmms-dialog-item-title">保养工单基本信息</div>
         <a-row>
           <a-col :span="12">
             <a-form-model-item label="保养工单编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upkeepcode">
-              {{model.upkeepcode}}
-              <!-- <a-input v-model="model.upkeepcode" placeholder="请输入保养工单编号"  ></a-input> -->
+              <!-- {{model.upkeepcode}} -->
+              <a-input v-model="model.upkeepcode" placeholder="请输入保养工单编号" :disabled="true" ></a-input>
             </a-form-model-item>
           </a-col>
           <a-col :span="12">
             <a-form-model-item label="计划名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planname">
-              {{model.planname}}
-              <!-- <a-input v-model="model.planname" placeholder="请输入计划名称"  ></a-input> -->
+              <!-- {{model.planname}} -->
+              <a-input v-model="model.planname" placeholder="请输入计划名称" :disabled="true" ></a-input>
             </a-form-model-item>
           </a-col>
           <!-- <a-col :span="12">
@@ -37,8 +38,8 @@
           </a-col> -->
           <a-col :span="12">
             <a-form-model-item label="地点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address">
-              {{model.address}}
-              <!-- <a-input v-model="model.address" placeholder="请输入地点"  ></a-input> -->
+              <!-- {{model.address}} -->
+              <a-input v-model="model.address" placeholder="请输入地点" :disabled="true" ></a-input>
             </a-form-model-item>
           </a-col>
           <!-- <a-col :span="12">
@@ -63,8 +64,8 @@
           </a-col> -->
           <a-col :span="12">
             <a-form-model-item label="负责人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chargeruser">
-              {{model.chargeruser_dictText}}
-              <!-- <j-dict-select-tag v-model="model.chargeruser" placeholder="请选择负责人" dictCode="sys_user,realname,id"/> -->
+              <!-- {{model.chargeruser_dictText}} -->
+              <j-dict-select-tag v-model="model.chargeruser" placeholder="请选择负责人" dictCode="sys_user,realname,id" :disabled="true"/>
             </a-form-model-item>
           </a-col>
           <a-col :span="12">
@@ -75,10 +76,14 @@
           </a-col>
           <a-col :span="12">
           </a-col>
-          <a-col :span="24">
+          <!-- <a-col :span="24">
             <a-form-model-item label="描述" :labelCol="labelCol2" :wrapperCol="wrapperCol2" prop="upkeepdesc">
               <a-textarea v-model="model.upkeepdesc" placeholder="请输入描述"  :auto-size="{ minRows: 2, maxRows: 2 }"></a-textarea>
-              <!-- <a-input v-model="model.upkeepdesc" placeholder="请输入描述"  ></a-input> -->
+            </a-form-model-item>
+          </a-col> -->
+          <a-col :span="24">
+            <a-form-model-item label="照片" :labelCol="labelCol2" :wrapperCol="wrapperCol2" prop="remark">
+              <j-image-upload text="上传" v-model="model.files" isMultiple></j-image-upload>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
@@ -93,6 +98,18 @@
             </a-form-model-item>
           </a-col>
         </a-row>
+        <div class="cmms-dialog-item-title">设备保养设置</div>
+        <a-table
+          ref="table"
+          size="middle"
+          :scroll="{x:true}"
+          bordered
+          rowKey="id"
+          :columns="columns"
+          :dataSource="model.cmmsUpkeepItemDtoList"
+          :pagination="false"
+          class="j-table-force-nowrap">
+        </a-table>
       </a-form-model>
     </j-form-container>
   </a-spin>
@@ -118,18 +135,19 @@
     data () {
       return {
         model:{
-         },
+          cmmsUpkeepItemDtoList: []
+        },
         labelCol: {
           xs: { span: 24 },
-          sm: { span: 8 },
+          sm: { span: 6 },
         },
         wrapperCol: {
           xs: { span: 24 },
-          sm: { span: 13 },
+          sm: { span: 12 },
         },
         labelCol2: {
           xs: { span: 24 },
-          sm: { span: 4 },
+          sm: { span: 3 },
         },
         wrapperCol2: {
           xs: { span: 24 },
@@ -147,6 +165,38 @@
             { required: true, message: '请输入处理意见!'},
           ],
         },
+        columns: [
+          {
+            title:'保养项ID',
+            align:"center",
+            dataIndex: 'id'
+          },
+          {
+            title:'保养项名称',
+            align:"center",
+            dataIndex: 'itemname'
+          },
+          // {
+          //   title:'设备类型',
+          //   align:"center",
+          //   dataIndex: 'equiptypeName'
+          // },
+          {
+            title:'保养项编号',
+            align:"center",
+            dataIndex: 'itemcode'
+          },
+          {
+            title:'保养项标准',
+            align:"center",
+            dataIndex: 'itemcontent'
+          },
+          {
+            title:'备注',
+            align:"center",
+            dataIndex: 'remark'
+          },
+        ],
         url: {
           add: "/cmmsUpkeep/cmmsUpkeep/add",
           edit: "/cmmsUpkeep/cmmsUpkeep/edit",
@@ -186,6 +236,14 @@
               httpurl+=this.url.edit;
                method = 'put';
             }
+            if (this.model.files.length != 0) {
+              const a  = this.model.files.split(',')
+              this.model.files = a.map((res) => {
+                return {
+                  url: res
+                }
+              })
+            }
             httpAction(httpurl,this.model,method).then((res)=>{
               if(res.success){
                 that.$message.success(res.message);
@@ -202,4 +260,8 @@
       },
     }
   }
-</script>
+</script>
+
+<style scoped>
+@import "~@/assets/less/uStyle.less";
+</style>

+ 3 - 3
src/views/module_cmms/upkeep/modules/UpkeepModal.vue

@@ -1,15 +1,15 @@
 <template>
-  <j-modal
+  <u-modal
     :title="title"
     :width="width"
     :visible="visible"
-    switchFullscreen
+    contentFull
     @ok="handleOk"
     :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
     @cancel="handleCancel"
     cancelText="关闭">
     <upkeep-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></upkeep-form>
-  </j-modal>
+  </u-modal>
 </template>
 
 <script>