소스 검색

生产管理

chris 3 년 전
부모
커밋
0d49b19db2

+ 9 - 0
src/api/production.js

@@ -8,3 +8,12 @@ export function getSchedulingList (params) {
     params: params
   })
 }
+
+// 获取生产监控列表信息
+export function getMonitoringList (params) {
+  return request({
+    url: request.adornUrl(`/biz-service/ProductionMonitoring/list`),
+    method: 'get',
+    params: params
+  })
+}

+ 13 - 0
src/views/modules/production/monitoring-details.vue

@@ -0,0 +1,13 @@
+<template>
+
+</template>
+
+<script>
+  export default {
+    name: 'monitoring-details'
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 46 - 150
src/views/modules/production/monitoring.vue

@@ -1,49 +1,16 @@
 <!-- 生产监控管理 -->
 <template>
   <div class="production">
-    <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
-      <el-form-item label="采购编码">
-        <el-input v-model="dataForm.purchaseCode" placeholder="采购编码" clearable/>
+    <el-form :inline="true" :model="dataForm" @keyup.enter.native="queryPage()">
+      <el-form-item label="订单编号">
+        <el-input v-model="dataForm.orderCode" placeholder="订单编号" clearable/>
       </el-form-item>
-      <el-form-item label="说明">
-        <el-input v-model="dataForm.notes" placeholder="说明" clearable/>
-      </el-form-item>
-      <el-form-item label="类别">
-        <el-select
-          v-model="dataForm.purchaseType"
-          remote
-          placeholder="请选择">
-          <el-option
-            v-for="item in optionsType"
-            :key="item.code"
-            :label="item.value"
-            :value="item.code">
-          </el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="申请日期">
-        <el-date-picker
-          v-model="dataForm.applyDate"
-          value-format="yyyy-MM-dd"
-          type="date">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="状态">
-        <el-select
-          v-model="dataForm.purchaseState"
-          remote
-          placeholder="请选择">
-          <el-option
-            v-for="item in optionsState"
-            :key="item.code"
-            :label="item.value"
-            :value="item.code">
-          </el-option>
-        </el-select>
+      <el-form-item label="产品名称">
+        <el-input v-model="dataForm.productName" placeholder="产品名称" clearable/>
       </el-form-item>
       <el-form-item>
-        <el-button @click="search()">查询</el-button>
-        <el-button type="primary" @click="addOrUpdateHandle(0, false)">新建采购申请</el-button>
+        <el-button @click="queryPage()">查询</el-button>
+        <el-button type="primary" disabled @click="createNewProduct()">创建新产品</el-button>
       </el-form-item>
     </el-form>
     <el-table
@@ -58,61 +25,45 @@
         align="center">
       </el-table-column>
       <el-table-column
-        prop="purchaseCode"
-        header-align="center"
-        align="center"
-        min-width="100"
-        label="采购编码">
-      </el-table-column>
-      <el-table-column
-        prop="materialName"
+        prop="prodCode"
         header-align="center"
         align="center"
-        min-width="120"
-        label="物品名称">
+        label="产品编号">
       </el-table-column>
       <el-table-column
-        prop="purchaseType"
+        prop="productName"
         header-align="center"
         align="center"
-        :formatter="formatType"
-        label="采购类别">
+        label="产品名称">
       </el-table-column>
       <el-table-column
-        prop="createTime"
-        header-align="center"
-        align="center"
-        min-width="160"
-        label="申请时间">
-      </el-table-column>
-      <el-table-column
-        prop="applierName"
+        prop="progressBar"
         header-align="center"
         align="center"
         min-width="100"
-        label="申请人">
+        label="生产进度">
+        <template slot-scope="scope">
+          <el-progress :percentage="50"></el-progress>
+        </template>
       </el-table-column>
       <el-table-column
-        prop="deptName"
+        prop="contactDate"
         header-align="center"
         align="center"
-        min-width="100"
-        label="申请部门">
+        label="交期时间">
       </el-table-column>
       <el-table-column
-        prop="notes"
+        prop="orderCode"
         header-align="center"
         align="center"
-        min-width="180"
-        :show-overflow-tooltip="true"
-        label="说明">
+        label="订单编码">
       </el-table-column>
       <el-table-column
-        prop="purchaseState"
+        prop="customerName"
         header-align="center"
         align="center"
-        :formatter="formatState"
-        label="当前状态">
+        min-width="120"
+        label="客户名称">
       </el-table-column>
       <el-table-column
         fixed="right"
@@ -121,9 +72,7 @@
         width="150"
         label="操作">
         <template slot-scope="scope">
-          <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.purchaseId, true)">查看</el-button>
-          <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.purchaseId, false)">编辑</el-button>
-          <el-button style="color: red" type="text" size="small" @click="revokeHandle(scope.row.purchaseId)">撤回</el-button>
+          <el-button type="text" size="small" @click="detail(scope.row.id, true)">查看</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -136,20 +85,20 @@
       :total="totalPage"
       layout="total, sizes, prev, pager, next, jumper">
     </el-pagination>
-    <!-- 弹窗, 新增 / 修改 -->
-<!--    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>-->
+    <!-- 弹窗, 查看 -->
+    <detail v-if="detailsVisible" ref="details" @refreshDataList="getDataList"/>
   </div>
 </template>
 
 <script>
-  // import AddOrUpdate from './purchase-add-or-update'
-  import { getDictList } from '@/api/dict'
-  import { getPurchaseList, revokePurchase } from '@/api/sale'
+  import Detail from './monitoring-details'
+  import { getMonitoringList } from '@/api/production'
   export default {
     name: 'monitoring',
+    components: {Detail},
     data () {
       return {
-        addOrUpdateVisible: false,
+        detailsVisible: false,
         dataForm: {},
         dataList: [],
         pageIndex: 1,
@@ -157,64 +106,42 @@
         totalPage: 0,
         dataListLoading: false,
         dataListSelections: [],
-        optionsType: [],
-        // 审批状态:0 待提交 1 待审批 2 审批中 3 审批完成 4 审批不通过
+        // 状态:1:待排产,2:生产中,3:生产完成
         optionsState: [
-          {
-            code: '0',
-            value: '待提交'
-          },
           {
             code: '1',
-            value: '待审批'
+            value: '待排产'
           },
           {
             code: '2',
-            value: '审批中'
+            value: '生产中'
           },
           {
             code: '3',
-            value: '审批完成'
-          },
-          {
-            code: '4',
-            value: '审批不通过'
+            value: '生产完成'
           }
         ]
       }
     },
     created () {
-      this.getTypeList()
       this.getDataList()
     },
     methods: {
-      // 获取采购类别字典
-      getTypeList () {
-        getDictList({type: 'purchase_type'}).then(({data}) => {
-          if (data) {
-            this.optionsType = data
-          }
-        })
-      },
       // 查询
-      search () {
+      queryPage () {
         this.pageIndex = 1
         this.getDataList()
       },
       // 获取数据列表
       getDataList () {
         this.dataListLoading = true
-        this.addOrUpdateVisible = false
         let params = {
           'current': this.pageIndex,
           'size': this.pageSize,
-          'applyDate': this.dataForm.applyDate ? this.dataForm.applyDate : null,
-          'notes': this.dataForm.notes ? this.dataForm.notes : null,
-          'purchaseState': this.dataForm.purchaseState ? this.dataForm.purchaseState : null,
-          'purchaseType': this.dataForm.purchaseType ? this.dataForm.purchaseType : null,
-          'purchaseCode': this.dataForm.purchaseCode ? this.dataForm.purchaseCode : null
+          'productName': this.dataForm.productName ? this.dataForm.productName : null,
+          'orderCode': this.dataForm.orderCode ? this.dataForm.orderCode : null
         }
-        getPurchaseList(params).then(({data}) => {
+        getMonitoringList(params).then(({data}) => {
           if (data && data.code === '200') {
             this.dataList = data.data.records
             this.totalPage = Number(data.data.total)
@@ -222,33 +149,10 @@
             this.dataList = []
             this.totalPage = 0
           }
+          console.log('monitor')
           this.dataListLoading = false
         })
       },
-      revokeHandle (id) {
-        if (!id) return
-        let data = {id: id}
-        this.$confirm(`确定撤回?`, '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          revokePurchase(data).then(({data}) => {
-            if (data && data.code === '200') {
-              this.$message({
-                message: '操作成功',
-                type: 'success',
-                duration: 1500,
-                onClose: () => {
-                  this.getDataList()
-                }
-              })
-            } else {
-              this.$message.error(data.msg)
-            }
-          })
-        }).catch(() => {})
-      },
       // 每页数
       sizeChangeHandle (val) {
         this.pageSize = val
@@ -265,24 +169,15 @@
         this.dataListSelections = val
       },
       // 新增 / 修改
-      addOrUpdateHandle (id, disable) {
-        this.addOrUpdateVisible = true
+      detail (id, disable) {
+        this.detailsVisible = true
         this.$nextTick(() => {
-          this.$refs.addOrUpdate.init(id, disable)
+          this.$refs.details.init(id, disable)
         })
       },
-      // 转换属性“类别”
-      formatType (row) {
-        if (this.optionsType && row.purchaseType) {
-          const item1 = this.optionsType.find((item) => item.code === row.purchaseType.toString())
-          return item1 ? item1.value : ''
-        }
-      },
-      // 转换属性“是否组合产品”
-      formatState (row) {
-        if (!row.purchaseState) return ''
-        const item1 = this.optionsState.find((item) => item.code === row.purchaseState.toString())
-        return item1 ? item1.value : ''
+      // 创建新产品
+      createNewProduct () {
+        this.$message.warning('功能暂未开放')
       }
     }
   }
@@ -291,3 +186,4 @@
 <style scoped>
 
 </style>
+

+ 0 - 2
src/views/modules/production/scheduling.vue

@@ -27,14 +27,12 @@
         prop="orderCode"
         header-align="center"
         align="center"
-        min-width="100"
         label="订单编码">
       </el-table-column>
       <el-table-column
         prop="customerName"
         header-align="center"
         align="center"
-        min-width="120"
         label="客户名称">
       </el-table-column>
       <el-table-column