فهرست منبع

bugfix:198/199

chrislee 1 سال پیش
والد
کامیت
cc545e5181

+ 9 - 0
src/api/task.js

@@ -63,6 +63,15 @@ export function damageTask (data) {
   })
 }
 
+// 确认
+export function confirm (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/WorkController/confirm`),
+    method: 'post',
+    data
+  })
+}
+
 // 移交记录列表信息
 export function getTransferList (params) {
   return request({

+ 7 - 1
src/utils/enums.js

@@ -26,7 +26,8 @@ export const nodeStateOption = [
     {label: '已完成', value: '3'},
     {label: '等待处理', value: '4'},
     {label: '异常完成', value: '5'},
-    {label: '暂停', value: '6'}
+    {label: '暂停', value: '6'},
+    {label: '待确认', value: '7'}
 ]
 
 // 项目类别
@@ -70,3 +71,8 @@ export const bomStateOption = [
   {label: '正常', value: '1'},
   {label: '暂停生产', value: '2'}
 ]
+
+export const writeStateOption = [
+  {label: '只读', value: '1'},
+  {label: '读写', value: '2'}
+]

+ 82 - 6
src/views/modules/tech/product-management.vue

@@ -19,6 +19,9 @@
             </el-option>
           </el-select>
         </el-form-item>
+        <el-form-item label="图号">
+          <el-input v-model="dataForm.mapNumber" placeholder="图号" clearable/>
+        </el-form-item>
         <el-form-item>
           <el-button @click="search()">查询</el-button>
           <el-button v-if="isAuth('pro:product:save')" type="primary" @click="addOrUpdateHandle(0, false)">新建</el-button>
@@ -219,12 +222,23 @@
           fixed="right"
           header-align="center"
           align="center"
-          width="200"
+          min-width="80"
+          :formatter="formatReadState"
+          :show-overflow-tooltip="true"
+          label="读写状态">
+        </el-table-column>
+        <el-table-column
+          fixed="right"
+          header-align="center"
+          align="center"
+          width="240"
           label="操作">
           <template slot-scope="scope">
             <el-button v-if="isAuth('pro:product:info')" type="text" size="small" @click="detailHandle(scope.row.productId)">查看</el-button>
             <el-button v-if="isAuth('pro:product:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.productId, false)">编辑</el-button>
             <el-button v-if="isAuth('pro:product:change')" type="text" size="small" @click="changeHandle(scope.row.productId)">变更</el-button>
+            <el-button v-if="isAuth('pro:product:read') && Number(scope.row.writeState) === 2" type="text" size="small" @click="readHandle(scope.row.productId)">只读</el-button>
+            <el-button v-if="isAuth('pro:product:write') && Number(scope.row.writeState) === 1" type="text" size="small" @click="writeHandle(scope.row.productId)">读写</el-button>
             <el-button v-if="isAuth('pro:product:pause') && Number(scope.row.state) === 1" type="text" size="small" @click="pauseHandle(scope.row.productId)">暂停生产</el-button>
             <el-button v-if="isAuth('pro:product:regain') && Number(scope.row.state) === 2" type="text" size="small" @click="regainHandle(scope.row.productId)">恢复生产</el-button>
           </template>
@@ -262,7 +276,7 @@
   import AttachDetail from '../common/attach-detail'
   import NoticeChangeSetting from './product-notice-change-setting'
   import ChangeForm from './product-change'
-  import {bomStateOption} from '@/utils/enums'
+  import {bomStateOption, writeStateOption} from '@/utils/enums'
 export default {
     name: 'product-management',
     components: {
@@ -292,7 +306,8 @@ export default {
         dataListLoading: false,
         dataListSelections: [],
         optionsType: [],
-        bomStateOption: bomStateOption
+        bomStateOption: bomStateOption,
+        writeStateOption: writeStateOption
       }
     },
     created () {
@@ -329,10 +344,9 @@ export default {
         this.dataListLoading = true
         this.addOrUpdateVisible = false
         let params = {
+          ...this.dataForm,
           'current': this.pageIndex,
-          'size': this.pageSize,
-          'productName': this.dataForm.productName ? this.dataForm.productName : null,
-          'productType': this.dataForm.productType ? this.dataForm.productType : null
+          'size': this.pageSize
         }
         getProductList(params).then(({data}) => {
           if (data && data.code === '200') {
@@ -478,6 +492,14 @@ export default {
         }
         return ''
       },
+      formatReadState (row) {
+        if (!row.writeState) return ''
+        let option = this.writeStateOption.find(t => t.value === row.writeState)
+        if (option != null) {
+          return option.label
+        }
+        return ''
+      },
       pauseHandle (id) {
         if (!id) return
         this.$confirm(`确定暂停?`, '提示', {
@@ -531,6 +553,60 @@ export default {
             }
           })
         }).catch(() => {})
+      },
+      readHandle (id) {
+        if (!id) return
+        this.$confirm(`确定只读?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.$http({
+            url: this.$http.adornUrl(`/biz-service/product/read`),
+            method: 'POST',
+            data: {id: id}
+          }).then(({data}) => {
+            if (data && data.code === '200') {
+              this.$message({
+                message: '操作成功',
+                type: 'success',
+                duration: 1500,
+                onClose: () => {
+                  this.getDataList()
+                }
+              })
+            } else {
+              this.$message.error(data.msg)
+            }
+          })
+        }).catch(() => {})
+      },
+      writeHandle (id) {
+        if (!id) return
+        this.$confirm(`确定读写?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.$http({
+            url: this.$http.adornUrl(`/biz-service/product/write`),
+            method: 'POST',
+            data: {id: id}
+          }).then(({data}) => {
+            if (data && data.code === '200') {
+              this.$message({
+                message: '操作成功',
+                type: 'success',
+                duration: 1500,
+                onClose: () => {
+                  this.getDataList()
+                }
+              })
+            } else {
+              this.$message.error(data.msg)
+            }
+          })
+        }).catch(() => {})
       }
     }
   }

+ 29 - 3
src/views/modules/works/work-center.vue

@@ -1,7 +1,7 @@
 <!-- 工单中心 -->
 <template>
   <div class="stock">
-    <template v-if="!addOrUpdateVisible && !detailVisible">
+    <template v-if="!addOrUpdateVisible && !detailVisible && !confirmVisible">
         <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
         <el-form-item label="工单名称">
           <el-input v-model="dataForm.taskName" placeholder="工单名称" clearable/>
@@ -103,6 +103,15 @@
             label="工单内容"
         >
         </el-table-column>
+        <el-table-column
+          prop="backExplain"
+          header-align="center"
+          align="center"
+          min-width="140"
+          :show-tooltip-when-overflow="true"
+          label="退回说明"
+        >
+        </el-table-column>
         <el-table-column
             prop="planCompletionTime"
             header-align="center"
@@ -225,7 +234,7 @@
             fixed="right"
             header-align="center"
             align="center"
-            width="180"
+            width="100"
             label="操作"
         >
             <template slot-scope="scope">
@@ -240,6 +249,12 @@
                     size="small"
                     @click="addOrUpdateHandle(scope.row.taskId, scope.row)"
                     >编辑</el-button>
+              <el-button
+                v-if="isAuth('work:clt:confirm') && Number(scope.row.state) === 7"
+                type="text"
+                size="small"
+                @click="confirmHandle(scope.row.taskId)"
+              >确认</el-button>
             </template>
         </el-table-column>
       </el-table>
@@ -257,6 +272,7 @@
     <attach-detail-dialog ref="attachDetail" />
     <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>
+    <work-confirm v-if="confirmVisible" ref="confirm" @onChose="onChose" @refreshDataList="getDataList"/>
   </div>
 </template>
 
@@ -269,14 +285,16 @@ import UserComponent from '@/views/modules/common/user-component'
 import AttachDetailDialog from '../common/attach-detail-dialog'
 import WorderAddOrUpdate from '../worder/add-or-update'
 import WorkCenterDetail from './work-center-detail'
+import WorkConfirm from '@/views/modules/works/work-confirm'
 export default {
   name: 'works-work-center',
-  components: {UserComponent, AttachDetailDialog, WorderAddOrUpdate, WorkCenterDetail},
+  components: {WorkConfirm, UserComponent, AttachDetailDialog, WorderAddOrUpdate, WorkCenterDetail},
   data () {
     return {
       addOrUpdateVisible: false,
       detailVisible: false,
       dataListLoading: false,
+      confirmVisible: false,
       pageIndex: 1,
       pageSize: 10,
       totalPage: 0,
@@ -289,11 +307,13 @@ export default {
   },
   created () {
     this.getDataList()
+    // this.dataForm.dispatcher = this.$store.state.user.id
   },
   methods: {
     onChose () {
       this.addOrUpdateVisible = false
       this.detailVisible = false
+      this.confirmVisible = false
     },
     userChanged (val) {
     //   this.dataForm.userId = val
@@ -341,6 +361,12 @@ export default {
         this.$refs.worder.init(taskId, item, 'update')
       })
     },
+    confirmHandle (taskId) {
+      this.confirmVisible = true
+      this.$nextTick(() => {
+        this.$refs.confirm.init(taskId)
+      })
+    },
     startTask () {},
     attachDetails (attachList) {
       this.$refs.attachDetail.init(attachList)

+ 94 - 0
src/views/modules/works/work-confirm.vue

@@ -0,0 +1,94 @@
+<template>
+  <div>
+      <div class="my-title">确认</div>
+      <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
+        <el-row class="my-row">
+          <el-col :span="8">
+            <el-form-item label="确认状态" prop="confirmState">
+              <el-select
+                v-model="dataForm.confirmState"
+                placeholder="请选择">
+                <el-option v-for="item in options"
+                           :key="item.value"
+                           :label="item.label"
+                           :value="item.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="16" style="padding-left: 20px">
+            <el-form-item label="退回说明" prop="backExplain">
+              <el-input v-model="dataForm.backExplain" placeholder="退回说明"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+          <el-button @click="onChose">取消</el-button>
+          <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
+        </span>
+  </div>
+</template>
+
+<script>
+  import {confirm} from '@/api/task'
+
+export default {
+    name: 'work-confirm',
+    data () {
+      return {
+        options: [{
+          value: '1',
+          label: '确认完成'
+        },
+        {
+          value: '2',
+          label: '退回'
+        }],
+        dataForm: {},
+        dataRule: {
+          confirmState: [{ required: true, message: '请选择确认状态', trigger: 'change' }]
+        }
+      }
+    },
+    methods: {
+      onChose () {
+        this.$emit('onChose')
+      },
+      async init (taskId) {
+        this.dataForm = {
+          taskId: taskId
+        }
+      },
+      validateField (type) {
+        this.$refs.dataForm.validateField(type)
+      },
+      // 表单提交
+      dataFormSubmit () {
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            confirm(this.dataForm).then(({data}) => {
+              if (data && data.code === '200') {
+                this.$message({
+                  message: '操作成功',
+                  type: 'success',
+                  duration: 1500,
+                  onClose: () => {
+                    this.onChose()
+                    this.$emit('refreshDataList')
+                  }
+                })
+              } else {
+                this.$message.error(data.msg)
+              }
+            }).catch(() => {})
+          }
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>