whj 1 年之前
父节点
当前提交
0f3ff6e097
共有 2 个文件被更改,包括 145 次插入12 次删除
  1. 105 5
      src/views/idle-assets/modules/BaseForm.vue
  2. 40 7
      src/views/idle-assets/modules/Detail.vue

+ 105 - 5
src/views/idle-assets/modules/BaseForm.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     :title="title"
-    :width="800"
+    :width="1300"
     :visible="visible"
     :confirmLoading="confirmLoading"
     @cancel="handleCancel"
@@ -42,7 +42,17 @@
             </a-form-item>
           </row-item>
         </row-list>
-
+        <row-list :col="1">
+          <row-item>
+            <a-form-item
+              label="申请原因"
+              :labelCol="BaseTool.Constant.labelCol2"
+              :wrapperCol="BaseTool.Constant.wrapperCol2"
+            >
+              <a-textarea v-decorator="['applyReason', { rules: [{required: true, message: '申请原因不能为空'}]}]" placeholder="请填写申请原因" />
+            </a-form-item>
+          </row-item>
+        </row-list>
       </a-form>
       <title-divider title="设备集合" width="90px"></title-divider>
       <a-button type="primary" @click="handleSbSelect">选择</a-button>
@@ -51,6 +61,7 @@
       <a-table
         :columns="columns"
         bordered
+        :scroll="{x: 1, y: BaseTool.Constant.scrollY }"
         :data-source="sbInfoDTOS"
       >
         <span slot="action" slot-scope="record">
@@ -59,6 +70,34 @@
             @click="handleUpLoad(record)"
           > {{ record.sbFileList.length>0?'查看图片':'上传图片' }} </operation-button>
         </span>
+        <template #newPositionNo="text,record">
+          <a-input v-model="record.newPositionNo" />
+        </template>
+        <template #clean="text,record">
+          <a-select style="width: 100%" v-model="record.clean" placeholder="请选择">
+            <a-select-option
+              v-for="(label,value) in yesNoMap"
+              :key="value"
+              :label="label"
+              :value="parseInt(value)">{{ label }}
+            </a-select-option>
+          </a-select>
+        </template>
+        <template #newPositionId="text,record">
+          <a-tree-select
+            style="width: 100%"
+            :dropdownStyle="{ maxHeight: '300px', overflow: 'auto' }"
+            :treeData="treeData"
+            :treeNodeFilterProp="'title'"
+            :showSearch="true"
+            v-model="record.newPositionId"
+            placeholder="请选择"
+          >
+          </a-tree-select>
+        </template>
+        <template #sbIntact="text,record">
+          <a-textarea v-model="record.sbIntact" placeholder="请填写铭牌、零部件、外观" />
+        </template>
       </a-table>
     </a-card>
     <template slot="footer">
@@ -74,6 +113,7 @@ import pick from 'lodash.pick'
 import { addSbUnused, getUnusedUsers, updataSbUnused } from '@/api/idle-assets/idle-assets'
 import SbInfoSelectModal from './SbInfoSelectModal'
 import UpLoad from './UpLoad'
+import { getSbPositionTree } from '@/api/sb/position'
 
 export default {
   name: 'BaseForm',
@@ -94,16 +134,56 @@ export default {
         {
           title: '设备名称',
           dataIndex: 'name',
+          width: 150,
           key: 'name'
         },
         {
           title: '设备位号',
           dataIndex: 'positionNo',
+          width: 150,
           key: 'positionNo'
         },
+        {
+          title: '新位号',
+          dataIndex: 'newPositionNo',
+          width: 150,
+          key: 'newPositionNo',
+          scopedSlots: { customRender: 'newPositionNo' }
+        },
+        {
+          title: '原设备位置',
+          dataIndex: 'oldPositionId',
+          width: 150,
+          key: 'oldPositionId',
+          customRender: (text, record) => {
+            return record.oldPositionName
+          }
+        },
+        {
+          title: '新设备位置',
+          dataIndex: 'newPositionId',
+          width: 150,
+          key: 'newPositionId',
+          scopedSlots: { customRender: 'newPositionId' }
+        },
+        {
+          title: '是否清洗',
+          width: 150,
+          dataIndex: 'clean',
+          key: 'clean',
+          scopedSlots: { customRender: 'clean' }
+        },
+        {
+          title: '设备完好性',
+          dataIndex: 'sbIntact',
+          width: 200,
+          key: 'sbIntact',
+          scopedSlots: { customRender: 'sbIntact' }
+        },
         {
           title: '设备编号',
           dataIndex: 'no',
+          width: 150,
           key: 'no'
         },
         {
@@ -115,12 +195,13 @@ export default {
           align: 'center',
           scopedSlots: { customRender: 'action' }
         }
-      ]
+      ],
+      yesNoMap: {}
     }
   },
 
   created () {
-    // this.flagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PROJECT_NEW_AND_OLD)
+    this.yesNoMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
     this.getUnusedUsers()
   },
   methods: {
@@ -147,7 +228,13 @@ export default {
           name: item.sbName,
           no: item.sbNo,
           sbFileList: item.usedFileList,
-          positionNo: item.positionNo
+          positionNo: item.positionNo,
+          newPositionNo: item.newPositionNo,
+          oldPositionName: item.oldPositionName,
+          oldPositionId: item.oldPositionId,
+          newPositionId: item.newPositionId,
+          clean: item.clean,
+          sbIntact: item.sbIntact
         }
       })
     },
@@ -155,6 +242,9 @@ export default {
       getUnusedUsers().then(res => {
         this.verityUserIdMap = res.data
       })
+      getSbPositionTree().then(res => {
+        this.treeData = res.data
+      })
     },
 
     handleSbSelect () {
@@ -170,6 +260,12 @@ export default {
           name: item.name,
           no: item.no,
           positionNo: item.positionNo,
+          newPositionNo: '',
+          oldPositionName: item.positionName,
+          oldPositionId: item.positionId,
+          newPositionId: '',
+          clean: 0,
+          sbIntact: '',
           sbFileList: []
         }
       })
@@ -201,11 +297,15 @@ export default {
           updataSbUnused(values).then(res => {
             this.$message.success('修改成功!')
             this.handleCancel()
+          }).catch(() => {
+            this.confirmLoading = false
           })
         } else {
           addSbUnused(values).then(res => {
             this.$message.success('创建成功!')
             this.handleCancel()
+          }).catch(() => {
+            this.confirmLoading = false
           })
         }
       })

+ 40 - 7
src/views/idle-assets/modules/Detail.vue

@@ -15,6 +15,7 @@
     <a-table
       :columns="columns"
       bordered
+      :scroll="{x: 1, y: BaseTool.Constant.scrollY }"
       :data-source="modal.sbUnusedDetailVOS"
     >
       <template #action="record">
@@ -69,32 +70,63 @@ export default {
       },
       visible: false,
       statusMap: {},
+      yesNoMap: {},
       columns: [
         {
           title: '设备名称',
           dataIndex: 'sbName',
+          width: 150,
           key: 'sbName'
         },
         {
           title: '设备位号',
           dataIndex: 'positionNo',
+          width: 150,
           key: 'positionNo'
         },
+        {
+          title: '新位号',
+          dataIndex: 'newPositionNo',
+          width: 150,
+          key: 'newPositionNo'
+        },
+        {
+          title: '原设备位置',
+          dataIndex: 'oldPositionName',
+          width: 150,
+          key: 'oldPositionName'
+        },
+        {
+          title: '新设备位置',
+          dataIndex: 'newPositionName',
+          width: 150,
+          key: 'newPositionName'
+        },
+        {
+          title: '是否清洗',
+          dataIndex: 'clean',
+          width: 150,
+          key: 'clean',
+          customRender: (text, record) => {
+            return this.BaseTool.Object.getField(this.yesNoMap, record.clean)
+          }
+        },
+        {
+          title: '设备完好性',
+          dataIndex: 'sbIntact',
+          width: 150,
+          key: 'sbIntact'
+        },
         {
           title: '设备编号',
           dataIndex: 'sbNo',
+          width: 150,
           key: 'sbNo'
         },
-        {
-          title: '所属车间',
-          dataIndex: 'positionName',
-          key: 'positionName'
-        },
         {
           title: '图片',
+          width: 150,
           key: 'action',
-          checked: true,
-          align: 'center',
           scopedSlots: { customRender: 'action' }
         }
       ],
@@ -104,6 +136,7 @@ export default {
   },
   created () {
     this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_UNUSED_STATUS)
+    this.yesNoMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
   },
   methods: {
     base (record) {