Browse Source

工单中心

damon227 1 year ago
parent
commit
e3dcc784c8

+ 1 - 1
src/utils/enums.js

@@ -19,7 +19,7 @@ export const transferTypeOption = [
 ]
 
 // 节点状态
-export const nodeStateOPtion = [
+export const nodeStateOption = [
     {label: '等待', value: '0'},
     {label: '未开始', value: '1'},
     {label: '进行中', value: '2'},

+ 5 - 3
src/views/modules/worder/add-or-update.vue

@@ -14,6 +14,7 @@
                 v-model="dataForm.taskType"
                 placeholder="请选择"
                 style="width: 100%"
+                :disabled="taskTypeDisable"
               >
                 <el-option
                   v-for="item in taskTypeOption"
@@ -132,8 +133,8 @@ export default {
       id: 0,
       type: '',
       visible: false,
-      isModify: false,
       display: false,
+      taskTypeDisable: false,
       bizType: 1,
       dataForm: {},
       attachList: [],
@@ -178,7 +179,9 @@ export default {
       this.id = id || 0
       this.type = type
       if (item) {
-        this.isModify = true
+        if (item.taskType) {
+          this.taskTypeDisable = true
+        }
         if (item.attachList) {
           item.attachList.map(t => {
             if (t.fileName) { t.name = t.fileName }
@@ -186,7 +189,6 @@ export default {
         }
         this.dataForm = item
       } else {
-        this.isModify = false
         this.dataForm = {
           recordId: Math.round(Math.random() * 1000000)
         }

+ 56 - 10
src/views/modules/works/work-center-detail.vue

@@ -2,12 +2,56 @@
   <div>
     <div class="my-title">查看</div>
     <div>
-        <e-desc title="基本信息" column="3">
-        <e-desc-item label="工艺名称">{{ dataForm.techName }}</e-desc-item>
-        <e-desc-item label="工艺版本">{{ dataForm.techVersion }}</e-desc-item>
-        <e-desc-item label="产品">{{ dataForm.productName }}</e-desc-item>
+      <e-desc title="基本信息" column="3">
+        <e-desc-item label="工单编码">{{ dataForm.taskCode }}</e-desc-item>
+        <e-desc-item label="工单类型"
+          >{{
+            taskTypeOption.findIndex((t) => t.value == dataForm.taskType) > -1
+              ? taskTypeOption.find((t) => t.value == dataForm.taskType).label
+              : ""
+          }}
+        </e-desc-item>
+        <e-desc-item label="工单级别"
+          >{{
+            rankTypeOption.findIndex((t) => t.value == dataForm.ranks) > -1
+              ? rankTypeOption.find((t) => t.value == dataForm.ranks).label
+              : ""
+          }}
+        </e-desc-item>
 
-        <e-desc-item label="备注" span="3">{{ dataForm.notes }}</e-desc-item>
+        <e-desc-item label="工单名称">{{ dataForm.taskName }}</e-desc-item>
+        <e-desc-item label="工单内容">{{ dataForm.content }}</e-desc-item>
+        <e-desc-item label="要求完成时间">{{
+          dataForm.planCompletionTime
+        }}</e-desc-item>
+
+        <e-desc-item label="派发人">{{ dataForm.dispatcherName }}</e-desc-item>
+        <e-desc-item label="派发部门">{{
+          dataForm.dispatcherOrgName
+        }}</e-desc-item>
+        <e-desc-item label="派发时间">{{ dataForm.createTime }}</e-desc-item>
+
+        <e-desc-item label="接收人">{{
+          dataForm.receiverName
+        }}</e-desc-item>
+        <e-desc-item label="接收部门">{{
+          dataForm.receiverOrgName
+        }}</e-desc-item>
+        <e-desc-item label="完成时间">{{ dataForm.endTime }}</e-desc-item>
+
+        <e-desc-item label="状态"
+          >{{
+            nodeStateOption.findIndex((t) => t.value == dataForm.state) > -1
+              ? nodeStateOption.find((t) => t.value == dataForm.state).label
+              : ""
+          }}
+        </e-desc-item>
+
+        <e-desc-item label="完成记录" span="3">{{
+          dataForm.operationRecords
+        }}</e-desc-item>
+
+        <e-desc-item label="备注" span="3">{{ dataForm.remark }}</e-desc-item>
       </e-desc>
       <e-desc title="附件">
         <upload-component
@@ -25,12 +69,11 @@
 </template>
 
 <script>
-import {
-  getTaskDetail
-} from '@/api/task'
+import { getTaskDetail } from '@/api/task'
 import EDesc from '../common/e-desc'
 import EDescItem from '../common/e-desc-item'
 import uploadComponent from '../common/upload-component'
+import { taskTypeOption, rankTypeOption, nodeStateOption } from '@/utils/enums'
 export default {
   name: 'work-center-detail',
   components: {
@@ -41,7 +84,10 @@ export default {
   data () {
     return {
       taskId: '',
-      dataForm: {}
+      dataForm: {},
+      taskTypeOption: taskTypeOption,
+      rankTypeOption: rankTypeOption,
+      nodeStateOption: nodeStateOption
     }
   },
   methods: {
@@ -51,7 +97,7 @@ export default {
       this.getTaskDetail()
     },
     getTaskDetail () {
-      getTaskDetail(this.taskId).then(({data}) => {
+      getTaskDetail(this.taskId).then(({ data }) => {
         if (data && data.code === '200' && data.data) {
           this.dataForm = data.data
         }

+ 11 - 10
src/views/modules/works/work-center.vue

@@ -33,7 +33,7 @@
         </el-form-item>
         <el-form-item>
           <el-button @click="getDataList()">查询</el-button>
-          <el-button v-if="isAuth('workcenter:clt:add')" type="primary" @click="addOrUpdateHandle('', null)">新增</el-button>
+          <el-button v-if="isAuth('workcenter:clt:add')" type="primary" @click="addOrUpdateHandle('', {})">新增</el-button>
         </el-form-item>
       </el-form>
       <el-table :data="dataList" border v-loading="dataListLoading" style="width:100%">
@@ -108,7 +108,7 @@
         >
         </el-table-column>
         <el-table-column
-            prop="taskCode"
+            prop="attachList"
             header-align="center"
             align="center"
             min-width="120"
@@ -118,11 +118,11 @@
             <template slot-scope="scope">
                 <el-button
                   :disabled="
-                    !scope.row.attachListVo || scope.row.attachListVo.length === 0
+                    !scope.row.attachList || scope.row.attachList.length === 0
                   "
                   type="text"
                   size="small"
-                  @click="attachDetails(scope.row.attachListVo)"
+                  @click="attachDetails(scope.row.attachList)"
                   >查看</el-button
                 >
             </template>
@@ -146,8 +146,8 @@
         >
             <template slot-scope="scope">
                 <span>{{
-                nodeStateOPtion.findIndex((t) => t.value == scope.row.state) > -1 
-                ? nodeStateOPtion.find((t) => t.value == scope.row.state).label
+                nodeStateOption.findIndex((t) => t.value == scope.row.state) > -1 
+                ? nodeStateOption.find((t) => t.value == scope.row.state).label
                 : ''
               }}</span>
             </template>
@@ -249,8 +249,8 @@
         </el-pagination>
     </template>
     <attach-detail-dialog ref="attachDetail" />
-    <worder-add-or-update v-if="addOrUpdateVisible" ref="worder" @onChose="onChose" />
-    <work-center-detail v-if="detailVisible" ref="detail"></work-center-detail>
+    <worder-add-or-update v-if="addOrUpdateVisible" ref="worder" @refreshDataList="getDataList" @onChose="onChose" />
+    <work-center-detail v-if="detailVisible" ref="detail"  @onChose="onChose"></work-center-detail>
   </div>
 </template>
 
@@ -258,7 +258,7 @@
 import {
   getTaskList
 } from '@/api/task'
-import {taskTypeOption, rankTypeOption, nodeStateOPtion} from '@/utils/enums'
+import {taskTypeOption, rankTypeOption, nodeStateOption} from '@/utils/enums'
 import UserComponent from '@/views/modules/common/user-component'
 import AttachDetailDialog from '../common/attach-detail-dialog'
 import WorderAddOrUpdate from '../worder/add-or-update'
@@ -278,7 +278,7 @@ export default {
       dataList: [],
       taskTypeOption: taskTypeOption,
       rankTypeOption: rankTypeOption,
-      nodeStateOPtion: nodeStateOPtion
+      nodeStateOption: nodeStateOption
     }
   },
   created () {
@@ -330,6 +330,7 @@ export default {
     },
     addOrUpdateHandle (taskId, item) {
       this.addOrUpdateVisible = true
+      item.taskType = 'routine'
       this.$nextTick(() => {
         this.$refs.worder.init(taskId, item, 'update')
       })