Browse Source

调整任务处理中心接口调用

chrislee 1 year ago
parent
commit
6d89aeebb1

+ 8 - 0
src/api/production.js

@@ -9,6 +9,14 @@ export function getSchedulingList (params) {
   })
 }
 
+// 物料列表
+export function getChildren (prodProductionId) {
+  return request({
+    url: request.adornUrl(`/biz-service/ProdProduction/queryByParentId/${prodProductionId}`),
+    method: 'get'
+  })
+}
+
 // 排产详情
 export function getInfo (id) {
   return request({

+ 1 - 1
src/views/modules/order/order-add-or-update.vue

@@ -99,7 +99,7 @@
               label="数量">
             </el-table-column>
             <el-table-column
-              prop="cnt"
+              prop="unit"
               header-align="center"
               align="center"
               width="80"

+ 7 - 0
src/views/modules/product/template-add-or-update.vue

@@ -17,6 +17,13 @@
               <el-input v-model="dataForm.productSpecifications" :disabled="bizType === 3" placeholder="规格"></el-input>
             </el-form-item>
           </el-col>
+        </el-row>
+        <el-row class="my-row">
+          <el-col :span="8">
+            <el-form-item label="单位" prop="cnt">
+              <el-input v-model="dataForm.unit" :disabled="bizType === 3" placeholder="单位"></el-input>
+            </el-form-item>
+          </el-col>
           <el-col :span="8">
             <el-form-item label="数量" prop="cnt">
               <el-input-number v-model="dataForm.cnt" :disabled="bizType === 3" ></el-input-number>

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

@@ -5,7 +5,11 @@
       <el-header style="font-size: large;text-align: center">任务处理中心</el-header>
       <el-table
         :data="dataList"
+        row-key="id"
         border
+        :indent='20'
+        lazy
+        :load="loadingData"
         v-loading="dataListLoading"
         style="width: 100%;">
         <el-table-column
@@ -18,7 +22,7 @@
           prop="orderCode"
           header-align="center"
           align="center"
-          min-width="120"
+          min-width="200"
           :show-tooltip-when-overflow="true"
           label="任务单编码">
         </el-table-column>
@@ -190,13 +194,14 @@
 <script>
   import Detail from './scheduling-details'
   import Outsource from '@/views/modules/sale/outsource-add-or-update'
-  import { getSchedulingList } from '@/api/production'
+  import { getSchedulingList, getChildren } from '@/api/production'
   import SchedulingCheck from '@/views/modules/production/scheduling-check'
   import SchedulingPreCheck from '@/views/modules/production/scheduling-pre-check'
   import PurchaseAddOrUpdate from '@/views/modules/sale/purchase-add-or-update'
   import SchedulingPurchase from '@/views/modules/production/scheduling-purchase'
   import SchedulingCommission from '@/views/modules/production/scheduling-commission'
   import CraftsDetail from '@/views/modules/tech/crafts-detail-dialog'
+import {downloadUrl} from '@/api/file'
 export default {
     name: 'scheduling',
     components: {
@@ -390,6 +395,22 @@ export default {
         this.$nextTick(() => {
           this.$refs.craftsDetail.init(id)
         })
+      },
+      loadingData (row, treeNode, resolve) {
+        getChildren(row.id).then(({data}) => {
+          if (data && data.code === '200') {
+            data.data.forEach(item => {
+              if (item.attachList2 && item.attachList2.length > 0) {
+                item.simplePic = downloadUrl + item.attachList2[0].url
+              } else {
+                item.simplePic = ''
+              }
+            })
+            resolve(data.data)
+          } else {
+            this.$message.error(data.msg)
+          }
+        })
       }
     }
   }