whj hace 2 años
padre
commit
a2116f6cbb

+ 26 - 0
src/api/fill/task.js

@@ -223,3 +223,29 @@ export function exportFillGatherTask (parameter) {
     responseType: 'blob'
   })
 }
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updateName (parameter) {
+  return axios({
+    url: '/fill/tasks/update/name',
+    method: 'PUT',
+    data: parameter
+  })
+}
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updatetasks (parameter) {
+  return axios({
+    url: '/fill/tasks/update',
+    method: 'POST',
+    data: parameter
+  })
+}

+ 18 - 4
src/views/fill/task/FillGatherTask.vue

@@ -28,7 +28,7 @@
       <div class="table-operator" style="margin-bottom: 8px;">
         <a-row>
           <a-col :md="16">
-<!--            <a-button v-if="$auth('fill-fills-add')" type="primary" icon="plus" @click="handleAdd()">新增</a-button>-->
+            <!--            <a-button v-if="$auth('fill-fills-add')" type="primary" icon="plus" @click="handleAdd()">新增</a-button>-->
             <a-button
               style="margin-left: 8px"
               v-if="$auth('fill-fills-export')"
@@ -68,6 +68,11 @@
         <span slot="status" slot-scope="status">
           <badge :status="DictCache.COLOR.FILL_GATHER_TASK_STATUS[status]" :text="statusMap[status]" />
         </span>
+        <template #name="text,record">
+          <span v-if="record.id===nameId"> <a-input style="width:170px" v-model="record.name" /> <a @click="changeName(record.id,record.name)">保存</a></span>
+          <span v-else >{{ text }} <a @click="nameId=record.id">编辑</a></span>
+
+        </template>
         <span slot="action" slot-scope="record">
           <template>
             <a @click="handleView(record)">查看</a>
@@ -131,7 +136,8 @@ import {
   getFillGatherTaskPage,
   deleteFillGatherTasks,
   fetchFillGatherTask,
-  exportFillGatherTask
+  exportFillGatherTask,
+  updateName
 } from '@/api/fill/task'
 
 export default {
@@ -156,6 +162,7 @@ export default {
     return {
       advanced: false,
       visible: true,
+      nameId: null,
       // 查询参数
       queryParam: {
         status: this.status
@@ -173,8 +180,9 @@ export default {
         },
         {
           title: '巡检任务名',
-          width: 150,
-          dataIndex: 'name'
+          width: 250,
+          dataIndex: 'name',
+          scopedSlots: { customRender: 'name' }
         },
         {
           title: '巡检人',
@@ -383,6 +391,12 @@ export default {
     },
     handleEnter () {
       this.$refs.table.refresh(true)
+    },
+    changeName (id, name) {
+      updateName({ id, name }).then(res => {
+        this.nameId = null
+        this.$message.info('修改成功!')
+      })
     }
   }
 }

+ 17 - 1
src/views/fill/task/modules/BaseForm.vue

@@ -79,6 +79,7 @@
               <th rowspan="2" width="100px">序号</th>
               <th rowspan="2" width="150px">车间</th>
               <th rowspan="2" width="150px">设备名称</th>
+              <th rowspan="2" width="150px">设备位号</th>
               <th rowspan="2" width="150px">设备编号</th>
               <th rowspan="2" width="150px">填报时间</th>
               <th :colspan="ListForm.length>0?ListForm[0].content.length:1">项目内容项</th>
@@ -94,6 +95,7 @@
               <td>{{ i+1 }}</td>
               <td>{{ item.positionName }}</td>
               <td>{{ item.sbName }}</td>
+              <td>{{ item.positionNo }}</td>
               <td>{{ item.sbNo }}</td>
               <td>{{ item.updateTime }}</td>
               <td v-for="li in item.content" :key="li.name">
@@ -110,6 +112,9 @@
                 <a-icon v-show="item.status === 1" type="check" style="color:#87d068;font-size: 26px;" />
               </td>
               <td>
+                <a-button v-if="editor" type="link" @click="handleDelete(item.sbId)">
+                  删除
+                </a-button>
                 <a-button v-if="editor" type="link" @click="handleRepair(item)">
                   报修
                 </a-button>
@@ -173,7 +178,7 @@
 </template>
 
 <script>
-import { fillGatherTask, getFillGatherTask, getFillUpdates, pauseFillGatherTask } from '@/api/fill/task'
+import { fillGatherTask, getFillGatherTask, getFillUpdates, pauseFillGatherTask, updatetasks } from '@/api/fill/task'
 import DispatchForm from './DispatchForm'
 import OvertimeForm from './OvertimeForm'
 import BaseFormRepair from './BaseFormRepair'
@@ -450,6 +455,17 @@ export default {
       this.type = 1
       this.status = null
       this.$emit('ok')
+    },
+    handleDelete (id) {
+      console.log(id)
+      updatetasks({
+        id: this.id,
+        detailIds: [id],
+        isAdd: 0
+      }).then(res => {
+        this.$message.info('操作成功!')
+        this.getInfo()
+      })
     }
   }
 }