chris пре 1 година
родитељ
комит
0bc3cdb640
2 измењених фајлова са 90 додато и 6 уклоњено
  1. 12 4
      src/utils/enums.js
  2. 78 2
      src/views/modules/tech/product-management.vue

+ 12 - 4
src/utils/enums.js

@@ -20,11 +20,13 @@ export const transferTypeOption = [
 
 // 节点状态
 export const nodeStateOption = [
-    {label: '待', value: '0'},
-    {label: '未开始', value: '1'},
-    {label: '进行中', value: '2'},
+    {label: '待派发', value: '0'},
+    {label: '已派发', value: '1'},
+    {label: '处理中', value: '2'},
     {label: '已完成', value: '3'},
-    {label: '异常完成', value: '4'}
+    {label: '等待处理', value: '4'},
+    {label: '异常完成', value: '5'},
+    {label: '暂停', value: '6'}
 ]
 
 // 项目类别
@@ -62,3 +64,9 @@ export const measureStateOption = [
     {label: '待验证', value: '2'},
     {label: '跟踪验证完成', value: '3'}
 ]
+
+// BOM清单状态
+export const bomStateOption = [
+  {label: '正常', value: '1'},
+  {label: '暂停生产', value: '2'}
+]

+ 78 - 2
src/views/modules/tech/product-management.vue

@@ -210,12 +210,23 @@
           fixed="right"
           header-align="center"
           align="center"
-          width="150"
+          min-width="80"
+          :formatter="formatState"
+          :show-overflow-tooltip="true"
+          label="状态">
+        </el-table-column>
+        <el-table-column
+          fixed="right"
+          header-align="center"
+          align="center"
+          width="200"
           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: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>
         </el-table-column>
       </el-table>
@@ -251,6 +262,7 @@
   import AttachDetail from '../common/attach-detail'
   import NoticeChangeSetting from './product-notice-change-setting'
   import ChangeForm from './product-change'
+  import {bomStateOption} from '@/utils/enums'
 export default {
     name: 'product-management',
     components: {
@@ -279,7 +291,8 @@ export default {
         totalPage: 0,
         dataListLoading: false,
         dataListSelections: [],
-        optionsType: []
+        optionsType: [],
+        bomStateOption: bomStateOption
       }
     },
     created () {
@@ -455,6 +468,69 @@ export default {
         this.$nextTick(() => {
           this.$refs.attachDetail.init(row.listingList)
         })
+      },
+      // 状态
+      formatState (row) {
+        if (!row.state) return ''
+        let option = this.bomStateOption.find(t => t.value === row.state)
+        if (option != null) {
+          return option.label
+        }
+        return ''
+      },
+      pauseHandle (id) {
+        if (!id) return
+        this.$confirm(`确定暂停?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.$http({
+            url: this.$http.adornUrl(`/biz-service/product/pause`),
+            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(() => {})
+      },
+      regainHandle (id) {
+        if (!id) return
+        this.$confirm(`确定恢复?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.$http({
+            url: this.$http.adornUrl(`/biz-service/product/regain`),
+            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(() => {})
       }
     }
   }